Re: Download File
| From: | Adam Voigt | Date: | Tue, 19 Nov 2002 16:10:43 +0000 |
| Subject: | Re: Download File | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-125105@lists.php.net to get a copy of this message | ||
PHP is true and blue in relation to error messages (in this case
anyway):
Warning: stat failed for http://host.com/document.doc
(errno=2 - No such
> file or directory) in d:\inetpub\wwwroot\dl-doc.php on line 8
The file either doesn't exist on "host.com" under the root directory
as "document.doc" or the webserver (on the host.com side) doesn't have
sufficient permission to serve "document.doc". Can you go to it in a
web browser?
On Tue, 2002-11-19 at 10:56, Michelle wrote:
> I would like to download a word-document from another site and save it to my
> harddrive.
> How would I go about doing this?
>
> I tried:
> <?php
> $filename = "http://host.com/document.doc;
>
> $fd = fopen ($filename, "rb");
> $string = fread ($fd, filesize ($filename)); <----ERROR
> fclose ($fd);
>
> $fname = "my_saved_doc.doc";
> $fp = fopen ($fname, "wb");
>
> ?>
>
> ERROR:
> Warning: stat failed for http://host.com/document.doc (errno=2
> - No such
> file or directory) in d:\inetpub\wwwroot\dl-doc.php on line 8
>
> I believe this has something to do with the access rights to the folders or
> something...
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
Adam Voigt (adam@cryptocomm.com)
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc