Search found 2 matches
- Mon Feb 02, 2009 11:22 am
- Forum: PHP - Code
- Topic: PHP copy()
- Replies: 3
- Views: 136
Re: PHP copy()
The cURL method didn't quite work the way I expected but I've never used it before and may have had a logic error. However you both gave me an idea...If I read the first 10 bytes of the file I can see if it's a PDF or the 404 page just by searching the string. This was the result: if(strchr(file_get...
- Mon Feb 02, 2009 10:40 am
- Forum: PHP - Code
- Topic: PHP copy()
- Replies: 3
- Views: 136
PHP copy()
I have a bit of code that downloads a remote file from another web server to the local web server. That part is easy: $srcRoot = "http://www.domain.com/thefile.pdf"; $desRoot = "../files/thefile.pdf"; copy($srcRoot,$desRoot); This works fine, except when the source file is not av...