mime_content_type remote file
mime_content_type remote file
am 04.06.2008 14:17:37 von Joris Willekens
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
";
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
RE: mime_content_type remote file
am 04.06.2008 15:12:19 von Stephen.Brereton
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:willekens@gmail.com]=0D
Sent: 04 June 2008 13:18
To: php-windows@lists.php.net
Subject: [PHP-WIN] mime_content_type remote file
Hello
I am using following to determine the mime_type of a remote file
$filename =3D str_replace("%20", " ",$_GET["image"]);
echo "Filetype: ". mime_content_type($filename) .
"\n\n\n\n\n\n\n
";
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
--=0D
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
* * * * * * * * * * * *=0D
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
Re: mime_content_type remote file
am 04.06.2008 16:30:05 von Joris Willekens
Yes, but with the same result
""Brereton, Stephen"" wrote in message
news:B5A1D7D67C4D854CBCE935F6707A8B2F034035FA@EVS1.york.gov. uk...
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:willekens@gmail.com]
Sent: 04 June 2008 13:18
To: php-windows@lists.php.net
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
";
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
RE: mime_content_type remote file
am 04.06.2008 16:31:46 von Stephen.Brereton
How about a file without any spaces in the name?
-----Original Message-----
From: Joris Willekens [mailto:willekens@gmail.com]=0D
Sent: 04 June 2008 15:30
To: php-windows@lists.php.net
Subject: Re: [PHP-WIN] mime_content_type remote file
Yes, but with the same result
""Brereton, Stephen"" wrote in message=0D
news:B5A1D7D67C4D854CBCE935F6707A8B2F034035FA@EVS1.york.gov. uk...
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:willekens@gmail.com]
Sent: 04 June 2008 13:18
To: php-windows@lists.php.net
Subject: [PHP-WIN] mime_content_type remote file
Hello
I am using following to determine the mime_type of a remote file
$filename =3D str_replace("%20", " ",$_GET["image"]);
echo "Filetype: ". mime_content_type($filename) .
"\n\n\n\n\n\n\n
";
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=0D
really need to.
* * * * * * * * * * * *
This communication is from City of York Council.
The information contained within, and in any attachment(s), is
confidential=0D
and legally privileged. It is for the exclusive use of the intended=0D
recipient(s). If you are not the intended recipient(s), please note that
any=0D
form of distribution, copying or use of this communication, or the=0D
information within, is strictly prohibited and may be unlawful. Equally,
you=0D
must not disclose all, or part, of its contents to any other person.
If you have received this communication in error, please return it=0D
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=0D
the content of this communication.=0D
--=0D
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
* * * * * * * * * * * *=0D
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
Re: mime_content_type remote file
am 05.06.2008 14:04:29 von Joris Willekens
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"" wrote in message
news:B5A1D7D67C4D854CBCE935F6707A8B2F034035FD@EVS1.york.gov. uk...
How about a file without any spaces in the name?
-----Original Message-----
From: Joris Willekens [mailto:willekens@gmail.com]
Sent: 04 June 2008 15:30
To: php-windows@lists.php.net
Subject: Re: [PHP-WIN] mime_content_type remote file
Yes, but with the same result
""Brereton, Stephen"" wrote in message
news:B5A1D7D67C4D854CBCE935F6707A8B2F034035FA@EVS1.york.gov. uk...
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:willekens@gmail.com]
Sent: 04 June 2008 13:18
To: php-windows@lists.php.net
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
";
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.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: mime_content_type remote file
am 05.06.2008 14:22:17 von Stephen.Brereton
Personally, I've always coded the spaces into underscores and made sure
the file is saved as that.
-----Original Message-----
From: Joris Willekens [mailto:willekens@gmail.com]=0D
Sent: 05 June 2008 13:04
To: php-windows@lists.php.net
Subject: Re: [PHP-WIN] mime_content_type remote file
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"" wrote in message=0D
news:B5A1D7D67C4D854CBCE935F6707A8B2F034035FD@EVS1.york.gov. uk...
How about a file without any spaces in the name?
-----Original Message-----
From: Joris Willekens [mailto:willekens@gmail.com]
Sent: 04 June 2008 15:30
To: php-windows@lists.php.net
Subject: Re: [PHP-WIN] mime_content_type remote file
Yes, but with the same result
""Brereton, Stephen"" wrote in message
news:B5A1D7D67C4D854CBCE935F6707A8B2F034035FA@EVS1.york.gov. uk...
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:willekens@gmail.com]
Sent: 04 June 2008 13:18
To: php-windows@lists.php.net
Subject: [PHP-WIN] mime_content_type remote file
Hello
I am using following to determine the mime_type of a remote file
$filename =3D str_replace("%20", " ",$_GET["image"]);
echo "Filetype: ". mime_content_type($filename) .
"\n\n\n\n\n\n\n
";
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=0D
really need to.
* * * * * * * * * * * *
This communication is from City of York Council.
The information contained within, and in any attachment(s), is
confidential=0D
and legally privileged. It is for the exclusive use of the intended=0D
recipient(s). If you are not the intended recipient(s), please note that
any=0D
form of distribution, copying or use of this communication, or the=0D
information within, is strictly prohibited and may be unlawful. Equally,
you=0D
must not disclose all, or part, of its contents to any other person.
If you have received this communication in error, please return it=0D
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=0D
the content of this communication.=0D
--=0D
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
* * * * * * * * * * * *=0D
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
Re: mime_content_type remote file
am 05.06.2008 14:27:29 von charles.wroth
I had trouble with spaces in pathnames. I got round it by surrounding the
whole pathname with quotes - an old Windows trick:
$s = "'" . $PHP_SELF . "'"; #surround with quotes to allow for spaces in
pathname
echo "
Re: mime_content_type remote file
am 05.06.2008 14:58:59 von Joris Willekens
Tx for the replies, I fixed the problem:
solution:
USE --> $filename = str_replace(" ", "%20",$_GET["image"]);
NOT --> $filename = str_replace("%20", " ",$_GET["image"]);
Best Regards
wrote in message
news:4847F7D1.9852.117446E@charles.wroth.exeter.ox.ac.uk...
>I had trouble with spaces in pathnames. I got round it by surrounding the
> whole pathname with quotes - an old Windows trick:
>
> $s = "'" . $PHP_SELF . "'"; #surround with quotes to allow for spaces in
> pathname
> echo "
>