I am currently tasked to make a website that allows a personnel of people to select possible candidates for a job.
From here, the candidate will upload their resume online to the PHP server. After which, the candidate will view the resume for review to see whether is the candidate suits for the job. I would like to know how is it possible to allow them to download the document from the server and/or view the documents online, probably in another browser page.
Thank you! :)
I would like to know how is it possible to allow them to download the document from the server and/or view the documents online, probably in another browser page.
After a file was moved from the temporary upload folder to your "uploads" folder, you are able to generate a download link to the file.
The file can be view "online", when the viewer opens the file in a new browser tab (by right-clicking the download link, then open in new tab) or you set target="_blank" on the link.
Most modern browsers have PDF support. I would only suggest to utilize a document viewer on server side, if the download links must be protected and the user-group is rather small, because this doesn't scale well.
Related
I'm developing a new website with PHP & MySQL.
The website is for an online eBook library that grant access to its books based on paid subscription plans.
So, I need to make sure the PDF files of these books are well protected and can't be saved, downloaded, or in anyway copied.
How can I do that?
I suggest you to convert the PDF into an image , and display the first page or as you like, check this library it can be useful
Imagemagick
I think this is not a PHP or MYSQL solution. PDF's have a "protected mode". There you can disable printing the pdf. You should look for a server side pdf recreation tool that can recreate the pdf in protected mode and serve the user this file. Take a deeper look into PDF functions. I think i can remember that there should also a trial mode also and the ability to view only on 1 device.
Here a link for more info: http://www.dummies.com/software/adobe/acrobat/restrict-who-can-edit-or-print-pdf-documents/
You'll be able lock down the files from unwanted downloads. But redistribution or sharing login details will be a battle.
Some options I can think of
Option 1:
You can handle this yourself on the server. Housing the PDFs outside of the public Apache directory (so there is no way a URL can reach it). Then with a PHP function read the contents of the file and stream it to the browser.
Streaming a large file using PHP
Option 2:
Use something like AWS S3. You can lock down the bucket so there is no public access. And generate signed URLs as needed. They'll be unique urls which you can specify a time limit of availablity. AWS S3 The security of a signed URL as a hyperlink
I am showing PDF, Video file preview in my web application, but i want to give only read access to users, no one can`t download PDF & video files, I want to prevent users, how can we prevent users to download it using PHP ? only they can view, please share you ideas as soon as.
Thanks
Any content that is shown on the client's side, technically speaking, already downloaded to the user's machine. If the user is seeing the PDF file - it's already been downloaded.
For video: it's not that straightforward, you can organize a streaming of the video. It'll be fairly more complex for the user to download it as one file, but still, can be captured.
Doing some research on trying to secure documents on a server so that visitors cannot copy paste the content.
Users can upload documents as pdf, doc, docx, and currently they can download these files in staging enviroment. Anyone know of a way I could either upload these as read only so once they are downloaded they cannot be edited or copy pasted etc?
Or is there a way I could get the contents of these files and display the content on a webpage while disabling copy paste etc?
Just looking for some ideas on a solution for this.
You cannot control web browser behavior.
The only way to do that is to use a script to render a part of a document.
For example, rendering page by page in a web view. But user could copy/past content even if you deploy some Javascript.
Perhaps, you should take a look to Flash, Silverlight or Java applet.
I think there are few solutions that can limit access to read only.
But il will mainly limited to computers.
You can protect a file with a password too.
Files could be downloaded but only users owning the password could edit them.
This is the case for PDF files, Excel files, etc.
It's a way but I don't think it's the best way.
I think the easiest way is to convert your documents as PDF files and to limit actions to read only by adding a password. You ll be able to disable write permission, print permission, etc. And rendering a PDF on a web page is very simple.
Is there any way to disable the download dialog box in Firefox, Chrome, IE, etc.. using php?
Because I have a project, its like a file management, where the users (client) will just view the files (.doc, .ppt, .pdf, etc) and they should not be able to download it.
For me, I think it cannot be.. But to you guys I know you have ideas on how to do it. Any suggestion is greatly appreciated..
they should not be able to download it
It does not depend how a browser offers a user-interface for a resource located at an internet-address (URL or URI): Dialog box or view-port - the file is always downloaded.
So the answer is no because a user is always able to download it - as the browser must be able to do so.
I used MS Office itself to convert all my docs to .html extension.. then I upload it to my intranet site.. so my members can only view the information I uploaded.. I used some javascript to disable the right click button so no one can save that file.
I would like to start a upload and download website for huge files (up to 1gb). I thought that it would be better to download the files using FTP (with PHP), because this protocol is especially used for these types of transfers.
The cliƫnt gets an email, including a download link to download the file (like yousendit.com). When they click on the link a download box appears. My problem is that I don't know how to show a download box using ftp and php. I have read that it isn't possible to immediately download a file by PHP, using FTP. Is this correct?
Do I have to create a temporary files on the server to let the client download the file? If yes, is this also a good solution for huge files?
What do you advice me to give the clients the possibility to download these huge files?
Thanks for your reply!
You can generate unique address based on session_id (create this folder on runtime and move huge file there) and redirect user to this link
For example, you have file huge.tgz
1. Send you client link http://***/user/john/file/huge.tgz
2. Ask user for auth in this page if they lost session
3. get session id
4. create on your server folder with name equals session id and move huge.tgz here
5. redirect user to unique ftp link ftp://***/17oe5kf8iYmpt66bjs89hcuo83/huge.tgz
You should disallow list files and directories on ftp server
Can't you send them an FTP link ? Why do you need PHP?
ftp://ftp12.freebsd.org/pub/FreeBSD/ls-lR.gz
You probably want to use PHP to handle everything but the file transfer. Once you have done all the checks you want you can redirect the browser to the file specifying the protocol as ftp. though you won't be able to have a progression bar in your site, the browser/ftp app will probably display one.