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 ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to