You are here: Mac OS X file name encoding problem « PHP « IT news, forums, messages
Mac OS X file name encoding problem

Posted by Giulio on 08/23/05 13:34

Hi all,

I have a problem with a script when it is runs on a Mac OS X
environment.

a part of this script simply takes an upoloaded temporary file and
writes it on the local system using ftp functions.

something like:

$filename = $TheNameToAssignToTheFile;
$ftps = ftp_connect($ftpaddress);
$ris = ftp_login($ftps,$ftpuser,$ftppassword);
$fi = fopen($_FILES['file']['tmp_name'],"rb");
ftp_fput($ftps,$filename,$fi,FTP_BINARY);
fclose($fi);

The problem appears when $filename contains special characters, like
accented chars, on Mac OS X the ftp_fput function returns me an error.

I thinked that the problem could depend on the filesystem encoding,
that on Mac OS X is Unicode, so I tryied this before:

$filename = utf8_encode($filename);

this way I have no more an error, but the file name of the uploaded
file results anyway corrupted with strange chars.

Any help is greatly appreciated,

Giulio

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация