php-windows Digest 5 Jun 2008 12:04:37 -0000 Issue 3484

Topics (messages 28921 through 28924):

Re: mime_content_type remote file
        28921 by: Joris Willekens
        28922 by: Brereton, Stephen
        28924 by: Joris Willekens

Strange - fgets/fgetsv ... 8 is not a valid stream resource
        28923 by: Anton Heuschen

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Yes, but with the same result

""Brereton, Stephen"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]

A 404 error only ever means the remote file cannot be found.
Being as you're swapping out the encoded spaces, I'd be inclined to
start with that as the possible cause - did you try the script with the
encoding still in place?

-----Original Message-----
From: Joris Willekens [mailto:[EMAIL PROTECTED]
Sent: 04 June 2008 13:18
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] mime_content_type remote file


Hello

I am using following to determine the mime_type of a remote file

$filename = str_replace("%20", " ",$_GET["image"]);
echo "Filetype: ". mime_content_type($filename) .
"\n\n\n\n\n\n\n<bR><br><br>";

When I view the link in browser, it's show ok. When i run the script, I
get following message:

Warning: mime_content_type(REMOTEURL/AMD AM2 X2.JPG)
[function.mime-content-type]: failed to open stream: HTTP request
failed! HTTP/1.1 404 Not Found

The remote file is on a Unix server, I know it's case sensitive.

Best Regards
Joris Willekens


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


* * * * * * * * * * * *
Help protect the environment - please don't print this email unless you really need to.
* * * * * * * * * * * *

This communication is from City of York Council.

The information contained within, and in any attachment(s), is confidential and legally privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s), please note that any form of distribution, copying or use of this communication, or the information within, is strictly prohibited and may be unlawful. Equally, you must not disclose all, or part, of its contents to any other person.

If you have received this communication in error, please return it immediately to the sender, then delete and destroy any copies of it.

City of York Council disclaims any liability for action taken in reliance on the content of this communication.
--- End Message ---
--- Begin Message ---
How about a file without any spaces in the name?

-----Original Message-----
From: Joris Willekens [mailto:[EMAIL PROTECTED]
Sent: 04 June 2008 15:30
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] mime_content_type remote file


Yes, but with the same result

""Brereton, Stephen"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

A 404 error only ever means the remote file cannot be found. Being as
you're swapping out the encoded spaces, I'd be inclined to start with
that as the possible cause - did you try the script with the encoding
still in place?

-----Original Message-----
From: Joris Willekens [mailto:[EMAIL PROTECTED]
Sent: 04 June 2008 13:18
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] mime_content_type remote file


Hello

I am using following to determine the mime_type of a remote file

 $filename = str_replace("%20", " ",$_GET["image"]);
 echo "Filetype: ". mime_content_type($filename) .
"\n\n\n\n\n\n\n<bR><br><br>";

When I view the link in browser, it's show ok. When i run the script, I
get following message:

Warning: mime_content_type(REMOTEURL/AMD AM2 X2.JPG)
[function.mime-content-type]: failed to open stream: HTTP request
failed! HTTP/1.1 404 Not Found

The remote file is on a Unix server, I know it's case sensitive.

Best Regards
Joris Willekens


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


* * * * * * * * * * * *
Help protect the environment - please don't print this email unless you
really need to.
* * * * * * * * * * * *

This communication is from City of York Council.

The information contained within, and in any attachment(s), is
confidential
and legally privileged. It is for the exclusive use of the intended
recipient(s). If you are not the intended recipient(s), please note that
any
form of distribution, copying or use of this communication, or the
information within, is strictly prohibited and may be unlawful. Equally,
you
must not disclose all, or part, of its contents to any other person.

If you have received this communication in error, please return it
immediately to the sender, then delete and destroy any copies of it.

City of York Council disclaims any liability for action taken in
reliance on
the content of this communication.


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


* * * * * * * * * * * *
Help protect the environment - please don't print this email unless you really 
need to.
* * * * * * * * * * * *

This communication is from City of York Council.

The information contained within, and in any attachment(s), is confidential and 
legally privileged. It is for the exclusive use of the intended recipient(s). 
If you are not the intended recipient(s), please note that any form of 
distribution, copying or use of this communication, or the information within, 
is strictly prohibited and may be unlawful. Equally, you must not disclose all, 
or part, of its contents to any other person.

If you have received this communication in error, please return it immediately 
to the sender, then delete and destroy any copies of it.

City of York Council disclaims any liability for action taken in reliance on 
the content of this communication.

--- End Message ---
--- Begin Message ---
There is no problem when there are no spaces in the name.
I can't prevent spaces in the filename, is there a workaround?

""Brereton, Stephen"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]

How about a file without any spaces in the name?

-----Original Message-----
From: Joris Willekens [mailto:[EMAIL PROTECTED]
Sent: 04 June 2008 15:30
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] mime_content_type remote file


Yes, but with the same result

""Brereton, Stephen"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

A 404 error only ever means the remote file cannot be found. Being as
you're swapping out the encoded spaces, I'd be inclined to start with
that as the possible cause - did you try the script with the encoding
still in place?

-----Original Message-----
From: Joris Willekens [mailto:[EMAIL PROTECTED]
Sent: 04 June 2008 13:18
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] mime_content_type remote file


Hello

I am using following to determine the mime_type of a remote file

$filename = str_replace("%20", " ",$_GET["image"]);
echo "Filetype: ". mime_content_type($filename) .
"\n\n\n\n\n\n\n<bR><br><br>";

When I view the link in browser, it's show ok. When i run the script, I
get following message:

Warning: mime_content_type(REMOTEURL/AMD AM2 X2.JPG)
[function.mime-content-type]: failed to open stream: HTTP request
failed! HTTP/1.1 404 Not Found

The remote file is on a Unix server, I know it's case sensitive.

Best Regards
Joris Willekens


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


* * * * * * * * * * * *
Help protect the environment - please don't print this email unless you
really need to.
* * * * * * * * * * * *

This communication is from City of York Council.

The information contained within, and in any attachment(s), is
confidential
and legally privileged. It is for the exclusive use of the intended
recipient(s). If you are not the intended recipient(s), please note that
any
form of distribution, copying or use of this communication, or the
information within, is strictly prohibited and may be unlawful. Equally,
you
must not disclose all, or part, of its contents to any other person.

If you have received this communication in error, please return it
immediately to the sender, then delete and destroy any copies of it.

City of York Council disclaims any liability for action taken in
reliance on
the content of this communication.


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


* * * * * * * * * * * *
Help protect the environment - please don't print this email unless you really need to.
* * * * * * * * * * * *

This communication is from City of York Council.

The information contained within, and in any attachment(s), is confidential and legally privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s), please note that any form of distribution, copying or use of this communication, or the information within, is strictly prohibited and may be unlawful. Equally, you must not disclose all, or part, of its contents to any other person.

If you have received this communication in error, please return it immediately to the sender, then delete and destroy any copies of it.

City of York Council disclaims any liability for action taken in reliance on the content of this communication.
--- End Message ---
--- Begin Message ---
Ive tried to use fget and fgetsv in different formats to parse my file
but keep getting:

Warning: fgetcsv(): 8 is not a valid stream resource in

My code for now looks like this:

 $handle = fopen($thefile, 'r');

 while(($data = fgetcsv($handle, 4096, ',')) !== FALSE)


It fails at the while part, ive even tried adding setlocale, like this
at start of php file:

setlocale(LC_ALL, 'en_US.UTF-8'); (Something found on Google)


But ive also done :

while (($data = fgetcsv($handle, 3000, "|")) !== FALSE)

$ids = fgets($fh, filesize($thefile)+1);


etc.......



I keep on getting the error, it throws out the first line, but then
after that as stated I get the error:

Warning: fgetcsv(): 8 is not a valid stream resource in C:\wa


Any idea what might be wrong?

P.S (ive tried adding file directly in  $handle =
fopen("somefile.txt", 'r');   even.
Also note the input file is a normal text file, created in notepad
saved as .txt, and each field is on its own line, looks like :

163888
157347
9813

no spaces infront or end of line

--- End Message ---

Reply via email to