niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
· nixdoc.net · man pages · Linux HOWTOs · FreeBSD Tips · Forums
navigation Forum index » Programming » PHP
Is URL for a big file valid? (sorry put bif first time)
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
Author Message
Julian Moorhouse
*nix forums beginner


Joined: 11 Jul 2006
Posts: 13

PostPosted: Sat Jul 15, 2006 7:42 pm    Post subject: Is URL for a big file valid? (sorry put bif first time) Reply with quote

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

PostPosted: Sat Jul 15, 2006 8:16 pm    Post subject: Re: Is URL for a big file valid? (sorry put bif first time) Reply with quote

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

PostPosted: Sat Jul 15, 2006 8:23 pm    Post subject: Re: Is URL for a big file valid? (sorry put bif first time) Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
The time now is Thu Sep 09, 2010 11:50 am | All times are GMT
navigation Forum index » Programming » PHP
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Postfix mail time out vanjre Postfix 0 Mon Jul 26, 2010 12:51 pm
No new posts Reusing Postfix configuration file - main.cf ptyagi FreeBSD 0 Wed Jul 08, 2009 9:17 pm
No new posts Running php file everyday on scheduled time sachin PHP 1 Fri Jul 21, 2006 12:49 pm
No new posts Regarding thesaurus iso file Srikanth modules 0 Fri Jul 21, 2006 10:42 am
No new posts how can i get a file descriptor not used? mars system 0 Fri Jul 21, 2006 7:41 am

Copyright © 2004-2005 DeniX Solutions SRL
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum |  email marketing service
 
Sponsors: Sports 2007 | Debt Management | Breast Enlargement | Property in Panama | Breast Enlargement
Privacy Policy
[ Time: 1.3677s ][ Queries: 17 (1.3409s) ][ GZIP on - Debug on ]