Re: mime_content_type remote file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 "<hr><br>
         <form action=$s method=post>" .	#use quotes
[ ...etc ]

Not sure if it applies in your case, but if not maybe it'll give you an idea.


On 5 Jun 2008 at 14:04, Joris Willekens wrote:

> 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"" <Stephen.Brereton@xxxxxxxxxxx> wrote in message 
> news:B5A1D7D67C4D854CBCE935F6707A8B2F034035FD@xxxxxxxxxxxxxxxxxxx
> 
> How about a file without any spaces in the name?
> 
> -----Original Message-----
> From: Joris Willekens [mailto:willekens@xxxxxxxxx]
> Sent: 04 June 2008 15:30
> To: php-windows@xxxxxxxxxxxxx
> Subject: Re:  mime_content_type remote file
> 
> 
> Yes, but with the same result
> 
> ""Brereton, Stephen"" <Stephen.Brereton@xxxxxxxxxxx> wrote in message
> news:B5A1D7D67C4D854CBCE935F6707A8B2F034035FA@xxxxxxxxxxxxxxxxxxx
> 
> 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@xxxxxxxxx]
> Sent: 04 June 2008 13:18
> To: php-windows@xxxxxxxxxxxxx
> Subject:  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. 
> 
> 



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


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux