Disabling download dialog box - php

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.

Related

View Document Online from PHP server

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.

how to force an only downloadable pdf in your browser to be viewable in the browser

I have been trying to display a data access policy(URL PDF file) in my tool and initially tried implementing it using the lighbox feature. It did not work for my PDF URL file but it did work for some other test PDF URL file.
I think the problem here is that the PDF is in ONLY DOWNLOADABLE FORMAT in a browser and NOT VIEWABLE in the browser.
I also tried to embed the source PDF URL file but it just returns a plain grey box and nothing else.
Can someone please tell me how can I force this PDF to be viewable in the browser so the user can see the agreement without downloading it?
Thanks.
/rd
content-disposition:inline is probably what you want.
Inline read into the browser
Attachment make it for download.
Can someone please tell me how can I force this PDF to be viewable in the browser so the user can see the agreement without downloading it?
If the user doesn't have a PDF reader installed or have his or her browser's MIME types set so that PDFs are open within it with a reader, there's no way you can control that. Also, even though it opens in a browser, the client can still save it locally, so the data is downloaded anyway.

Script downloading DI.FM list works only under Opera

Hello fellow stackoverflow'ers!
Today I was tired of old dead links to my fav internet radio, so I decided to make a downloader for all channels from di.fm. The idea was simple: download the page, get to the menu and parse it. After that create a playlist and make user download it.
So I created a PHP script as an API for my JS script. PHP functions were to download the page (JS cannot really do that), save playlist sent via POST in cookies and to provide it as a file. Cookies are supposed to be a communication channel between JS and PHP (with POST I cannot really make file download itself).
So far so good. Everything works like a charm under Opera. Things are getting complicated in Chrome and Firefox. Chrome reloads the page without a download dialog, Firefox works about the same, just sometimes lets me download the list... that is empty.
Any ideas how to solve it? Here is the code (feel free to use it yourself if you like it):
http://pastebin.com/dcEzxV9w
Thanks in advice,
Dracco

Protect audio file from being downloaded while still being playable through JQuery JPlayer

I have audio files saved in a folder on my server. They are called by JQuery JPlayer to be played. However if a person looks at the source of the page, they can find the location of the file and simply download it. I want to protect the files from being downloadable, but still allow JPlayer to play them. Is this possible?
I have tried denying the folder with .htaccess as well as password protecting the folder, but this prevents JPlayer from being able to play the files.
It's impossible to stop a savvy user stealing your media. But if you like, you could
use oAuth to govern access to the media resource
teach your server to only respond to media requests that contain "special" HTTP Headers, Cookies etc.
use DRM (washes mouth out)
some other URL obfuscating/expiring method you dream up..
To save time, i suggest you accept whatever you publish can be copied / taken. So, why not publish
a sample snippet (e.g. the first minute)
A lower-bitrate / mono taster version
Recently, a widget allowing you to stream Paul McCartney's new album was published in the Guardian.. how this is "secure" i don't know, I opened Chrome Dev Tools Network tab and helped myself to anything "audio/mpeg"!
I found a possible answer for you, using PHP:
Solution using PHP sessions
It's a long thread, but there's code there that will help you.
You should be aware (just in case you're not) that if someone can play the file in their browser, there is nothing to stop them playing the file and using recording software to capture the audio.

Linking remote files issue

I am placing href links to remote files for download simple as this with ajax:
Link
but it opens in new window and cuts off http:// and returns not found error, although if i refresh the page it will start downloading the file.
Maybe i could specify the content type and pass with header somehow but i dont want to pass the file through my server, it should download it from remote link.
Hope i could explain well.
Thank you.
sounds like the remote site has some protection against hot linking.
Are you certain that the link is correct? Try testing it externally first using an online flash player such as http://www.flvplayeronline.com/ . If the video plays then as #EvilSpaceHamster stated it could be a permissions issue on the server. I noticed you stated download? Is this a requirement or do you just want to grant the user access to view the file?

Categories