| Author |
Message |
Julian Moorhouse *nix forums beginner
Joined: 11 Jul 2006
Posts: 13
|
Posted: Sat Jul 15, 2006 7:42 pm Post subject:
Is URL for a big file valid? (sorry put bif first time)
|
|
|
Hi,
I've been struggling with this for hours over a few days.
I just can't find a solution.
I've tried fsocket, file, fopen.
But all seem to have problems.
I'm trying to quickly validate whether a file exists.
It could be a big file, maybe 200mb.
fopen and file, try to read the whole file.
fsockets with fputs($gh, "HEAD $hpath HTTP/1.0\n\n");
Doesn't like files in sub directories.
Can anyone help me?
Please.
I'd be grateful for code snippits as I've tried modifying lots of code
I found on forums and newsgroups without success.
Jules. |
|
| Back to top |
|
 |
Janwillem Borleffs *nix forums Guru
Joined: 20 Feb 2005
Posts: 404
|
Posted: Sat Jul 15, 2006 8:16 pm Post subject:
Re: Is URL for a big file valid? (sorry put bif first time)
|
|
|
mindwarp wrote:
| Quote: | fsockets with fputs($gh, "HEAD $hpath HTTP/1.0\n\n");
Doesn't like files in sub directories.
|
The newlines should be replaced with CRLF (\r\n\r\n), but besides that, this
should work fine.
It's possible that you are using windows-style slashes (\some\dir), in which
case you sould replace them with forward slashes (/some/dir).
You could also use GET and just read the first line to get the status code
and disconnect immediate after it.
JW |
|
| Back to top |
|
 |
Julian Moorhouse *nix forums beginner
Joined: 11 Jul 2006
Posts: 13
|
Posted: Sat Jul 15, 2006 8:23 pm Post subject:
Re: Is URL for a big file valid? (sorry put bif first time)
|
|
|
Hi,
thanks for your reply.
I discovered that my webserver didn't recognise resolve files on the
webserver.
So when i was testing I was using files on another domain i have with
my ISP.
:)
Jules. |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|