Re: [PHP] Serve a file using PHP
Thanks for your reply, I think my mail was blocked for a few days here. Sorry for the delay. a HREF='file:///home/users/grant/Parts.txt'file:///home/users/grant/Parts.txt/a This link will not work in Mozilla. (Does nothing) However, if I copy and paste the address into the addess bar, it works fine. I suspect this is a security thing. I don't think that PHP being server side should make a huge difference. The client and server are on the same network in this case, and the files would be on another server on the same network. Is there a way that the PHP server can access the file over the network and then send it to the client? I don't think I can make the client open the file itself. Thanks, Grant [EMAIL PROTECTED] wrote: Bit suprised that mozilla didn't let you access the file using the 'file://' notation. Did you actually use three slashes? ie it should be 'file:///home/grant' and not 'file://home/grant/' There isn't any other way in which you can use PHP to access files on a hard disk. PHP is a server side scripting language. You could always try signed java applets. -- Grant Rutherford Iders Incorporated 600A Clifton Street Winnipeg, MB R3G 2X6 http://www.iders.ca tel: 204-779-5400 ext 36 fax: 204-779-5444 Iders Incorporated: Confidential Note: This message is intended solely for the use of the designated recipient(s) and their appointed delegates, and may contain confidential information. Any unauthorized disclosure, copying or distribution of its contents is strictly prohibited. If you have received this message in error, please destroy it and advise the sender immediately by phone, Email or facsimile. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Serve a file using PHP
Hello, More suprising is that the html you have below works perfectly on my mozzilla 1.4 running on Red Hat 9 :-) provided i do have this exact path on my computer. /home/users/grant/Parts.txt From what you are saying it looks like in your case '/home/users/grant/Parts.txt' does not exist on your computer but exists on another one. I am sorry to say PHP being a server side scripting language indeed has a huge effect on this. One suggestion that i have is for you to you NFS (ouch) or samba and place that link in your php code. If you use NFS and mount it properly yes PHP being server side solution may not matter. :-) Other alternative is for you to use good old FTP. PHP has an FTP api, however since you are on the same network you can even create links such as fttp://othermachine/home/users/grant/parts.txt and it would work just fine. IN this case mozzila will open the ftp connection and fetch the file for you. all the best raditha Grant Rutherford wrote: Thanks for your reply, I think my mail was blocked for a few days here. Sorry for the delay. a HREF='file:///home/users/grant/Parts.txt'file:///home/users/grant/Parts.txt/a This link will not work in Mozilla. (Does nothing) However, if I copy and paste the address into the addess bar, it works fine. I suspect this is a security thing. I don't think that PHP being server side should make a huge difference. The client and server are on the same network in this case, and the files would be on another server on the same network. Is there a way that the PHP server can access the file over the network and then send it to the client? I don't think I can make the client open the file itself. Thanks, Grant [EMAIL PROTECTED] wrote: Bit suprised that mozilla didn't let you access the file using the 'file://' notation. Did you actually use three slashes? ie it should be 'file:///home/grant' and not 'file://home/grant/' There isn't any other way in which you can use PHP to access files on a hard disk. PHP is a server side scripting language. You could always try signed java applets. -- http://www.raditha.com/php/progress.php A progress bar for PHP file uploads. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Serve a file using PHP
Hello there, The line: a HREF='\\vesuvius\home\users\grant\Parts.txt'\\vesuvius\home\users\grant\Parts.txt/a Gives the object not found page in Mozilla, even when clicked on from the vesuvius computer. I think that it is treating this like a relative link. Thanks for the help, Grant CPT John W. Holmes wrote: Can't you just link to \\computer_name\path\to\file.doc (or whatever the filename is) ? file:/// would try to load it off of their machine, not a network machine. ---John Holmes... -- Grant Rutherford Iders Incorporated 600A Clifton Street Winnipeg, MB R3G 2X6 http://www.iders.ca tel: 204-779-5400 ext 36 fax: 204-779-5444 Iders Incorporated: Confidential Note: This message is intended solely for the use of the designated recipient(s) and their appointed delegates, and may contain confidential information. Any unauthorized disclosure, copying or distribution of its contents is strictly prohibited. If you have received this message in error, please destroy it and advise the sender immediately by phone, Email or facsimile. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Serve a file using PHP
Hi, Thanks for the advice. I will run this past the people in charge of the network. I'm afraid that I'm not really very familiar with our network here (I'm just an intern :) ) I am pretty sure that all of our files are sent from a single server, which is neither the php server or my computer. Perhaps I can get them to make the necessary files accessible by ftp or some other method. Thanks again, Grant Raditha Dissanayake wrote: Hello, More suprising is that the html you have below works perfectly on my mozzilla 1.4 running on Red Hat 9 :-) provided i do have this exact path on my computer. /home/users/grant/Parts.txt From what you are saying it looks like in your case '/home/users/grant/Parts.txt' does not exist on your computer but exists on another one. I am sorry to say PHP being a server side scripting language indeed has a huge effect on this. One suggestion that i have is for you to you NFS (ouch) or samba and place that link in your php code. If you use NFS and mount it properly yes PHP being server side solution may not matter. :-) Other alternative is for you to use good old FTP. PHP has an FTP api, however since you are on the same network you can even create links such as fttp://othermachine/home/users/grant/parts.txt and it would work just fine. IN this case mozzila will open the ftp connection and fetch the file for you. all the best raditha -- Grant Rutherford Iders Incorporated 600A Clifton Street Winnipeg, MB R3G 2X6 http://www.iders.ca tel: 204-779-5400 ext 36 fax: 204-779-5444 Iders Incorporated: Confidential Note: This message is intended solely for the use of the designated recipient(s) and their appointed delegates, and may contain confidential information. Any unauthorized disclosure, copying or distribution of its contents is strictly prohibited. If you have received this message in error, please destroy it and advise the sender immediately by phone, Email or facsimile. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Serve a file using PHP
Hello, Is there a way that PHP can allow a user to browse the files on the server's network, and ultimately send the file to the user? I'm making a database interface with PHP to be used internally on our network. Through a PHP interface, the user wants to browse their network and find a file, and insert the file's path into the database. The user then wants the database to display a link, which when clicked will open the file. They want this to work in Mozilla or IE, on both windows and linux machines. I tried making the path a link with file://path, but Mozilla wouldn't follow the link (probably a security thing; it makes sense that links shouldn't open local files). Is there a way that I can give PHP the network path (through $_POST for example), and it would return the file instead of an HTML document? Thanks for any help, Grant -- Grant Rutherford Iders Incorporated 600A Clifton Street Winnipeg, MB R3G 2X6 http://www.iders.ca tel: 204-779-5400 ext 36 fax: 204-779-5444 Iders Incorporated: Confidential Note: This message is intended solely for the use of the designated recipient(s) and their appointed delegates, and may contain confidential information. Any unauthorized disclosure, copying or distribution of its contents is strictly prohibited. If you have received this message in error, please destroy it and advise the sender immediately by phone, Email or facsimile. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Serve a file using PHP
Hello, Bit suprised that mozilla didn't let you access the file using the 'file://' notation. Did you actually use three slashes? ie it should be 'file:///home/grant' and not 'file://home/grant/' There isn't any other way in which you can use PHP to access files on a hard disk. PHP is a server side scripting language. You could always try signed java applets. all the best Grant Rutherford wrote: Hello, Is there a way that PHP can allow a user to browse the files on the server's network, and ultimately send the file to the user? I'm making a database interface with PHP to be used internally on our network. Through a PHP interface, the user wants to browse their network and find a file, and insert the file's path into the database. The user then wants the database to display a link, which when clicked will open the file. They want this to work in Mozilla or IE, on both windows and linux machines. I tried making the path a link with file://path, but Mozilla wouldn't follow the link (probably a security thing; it makes sense that links shouldn't open local files). Is there a way that I can give PHP the network path (through $_POST for example), and it would return the file instead of an HTML document? Thanks for any help, Grant -- http://www.raditha.com/php/progress.php A progress bar for PHP file uploads. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Serve a file using PHP
From: Grant Rutherford [EMAIL PROTECTED] Is there a way that PHP can allow a user to browse the files on the server's network, and ultimately send the file to the user? I'm making a database interface with PHP to be used internally on our network. Through a PHP interface, the user wants to browse their network and find a file, and insert the file's path into the database. The user then wants the database to display a link, which when clicked will open the file. They want this to work in Mozilla or IE, on both windows and linux machines. I tried making the path a link with file://path, but Mozilla wouldn't follow the link (probably a security thing; it makes sense that links shouldn't open local files). Is there a way that I can give PHP the network path (through $_POST for example), and it would return the file instead of an HTML document? Can't you just link to \\computer_name\path\to\file.doc (or whatever the filename is) ? file:/// would try to load it off of their machine, not a network machine. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php