mwbouwkamp Posted June 24, 2006 Share Posted June 24, 2006 Hi,I am trying to make a page that helps me open files on my computer. The thing I would like to do is to automatically open a file on my harddive by using some dropdown boxes and text fields in a form. Can anyone help?Marco Quote Link to comment https://forums.phpfreaks.com/topic/12827-use-php-to-open-a-pdf-file-on-my-hard-drive/ Share on other sites More sharing options...
AndyB Posted June 24, 2006 Share Posted June 24, 2006 No, nobody can help you do that because it simply is not possible - and a good thing too in terms of security. Quote Link to comment https://forums.phpfreaks.com/topic/12827-use-php-to-open-a-pdf-file-on-my-hard-drive/#findComment-49192 Share on other sites More sharing options...
mwbouwkamp Posted June 25, 2006 Author Share Posted June 25, 2006 What I tried now is to have php generate an url for me, which works fine... that is if I right click, say copy shortcut and past it into a new browser window. However, eventhough php generated the url for me, nothing happens when I click it. Is that some security thing too?Marco Quote Link to comment https://forums.phpfreaks.com/topic/12827-use-php-to-open-a-pdf-file-on-my-hard-drive/#findComment-49245 Share on other sites More sharing options...
benjrox Posted June 25, 2006 Share Posted June 25, 2006 Are you hosting the webserver on your computer AND accessing it from a browers [i]only[/i] from that computer? Or different ones?If you're doing from the same computer, you could use the file:/// protocol, I think.If it's on a remote server, you would have to add the directory where the .pdf as an alias into the webserver config. say as /pdf/, (make sure to password protect it though :)). Then you could link to it either on Windows: file:///C:\Documents%20and%20Settings\Fred\My%20Documents\PDFs\mypdf.pdf or Linux/Unix: file:///home/fred/mypdf.pdf (I'm not to sure about the Linux one, but I think the file protocol works, I haven't used Linux in along time) or you could use say [a href=\"http://www.mydomain.com/pdf/mypdf.pdf\" target=\"_blank\"]http://www.mydomain.com/pdf/mypdf.pdf[/a]But, don't trust me completly, I haven't actually tried this before, I only thought about it in the past :P (I think about a lot of neat scripts, but never bother to make 'em :P)Anyway, good luck!Benj Quote Link to comment https://forums.phpfreaks.com/topic/12827-use-php-to-open-a-pdf-file-on-my-hard-drive/#findComment-49249 Share on other sites More sharing options...
mwbouwkamp Posted June 25, 2006 Author Share Posted June 25, 2006 Here is my page... can anyone figure out why it doesnt work?[a href=\"http://mwbouwkamp.everywebhost.com/articles.php\" target=\"_blank\"]http://mwbouwkamp.everywebhost.com/articles.php[/a] Quote Link to comment https://forums.phpfreaks.com/topic/12827-use-php-to-open-a-pdf-file-on-my-hard-drive/#findComment-49442 Share on other sites More sharing options...
AndyB Posted June 25, 2006 Share Posted June 25, 2006 [!--quoteo(post=387833:date=Jun 25 2006, 04:18 PM:name=mwbouwkamp)--][div class=\'quotetop\']QUOTE(mwbouwkamp @ Jun 25 2006, 04:18 PM) [snapback]387833[/snapback][/div][div class=\'quotemain\'][!--quotec--]Here is my page... can anyone figure out why it doesnt work?[/quote]What are you expecting it do that "doesn't work"? Quote Link to comment https://forums.phpfreaks.com/topic/12827-use-php-to-open-a-pdf-file-on-my-hard-drive/#findComment-49453 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.