Ver Mensaje Individual
  #12 (permalink)  
Antiguo 20/12/2005, 11:24
cao
 
Fecha de Ingreso: septiembre-2003
Ubicación: Monterrey
Mensajes: 36
Antigüedad: 21 años, 2 meses
Puntos: 0
Estuve checando php.net pero no se si Cluster nos pueda ayudar a aclarar esta duda, especialmente con el comentario que hace un usuario en php.net:

http://php.mirror.ncsu.edu/manual/en...load.php#41615

Donde menciona un pequeño error al momento de subir archivos via mac


IE on the Mac is a bit troublesome. If you are uploading a file with an unknown file suffix, IE uploads the file with a mime type of "application/x-macbinary". The resulting file includes the resource fork wrapped around the file. Not terribly useful.

The following code assumes that the mime type is in $type, and that you have loaded the file's contents into $content. If the file is in MacBinary format, it delves into the resource fork header, gets the length of the data fork (bytes 83-86) and uses that to get rid of the resource fork.

(There is probably a better way to do it, but this solved my problem):

<?php
if ($type == 'application/x-macbinary') {
if (strlen($content) < 128) die('File too small');
$length = 0;
for ($i=83; $i<=86; $i++) {
$length = ($length * 256) + ord(substr($content,$i,1));
}
$content = substr($content,128,$length);
}
?>
__________________
C A O