php - getimagesize on application/octet-stream upload? -
i using mithril.js drag n drop, using formdata, sends end unable use getimagesize() on it. why need getimagesize because of library i'm using.
//var_dump on $_files array (size=1) 'upload' => array (size=5) 'name' => string '95ab94cadab44e81cfe6d3c83642680d.jpg' (length=36) 'type' => string 'image/jpeg' (length=10) 'tmp_name' => string '/tmp/phptj3ix3' (length=14) 'error' => int 0 'size' => int 743265
and heres var_dump on getimagesize($_files['upload']['tmp_name']);
boolean false
i've tried thinking uploading string:
$data = file_get_contents($_files['upload']['tmp_name']); $image = imagecreatefromstring($data); //the error imagecreatefromstring(): data not in recognized format
also tried var_dumping tmp file out
$data = file_get_contents($_files['upload']['tmp_name']); var_dump($data); //�����jfif��������8photoshop 3.0 ...
edit: size of file 392kb php says 743kb , unsure why
$binary_data = file_get_contents($_files['upload']['tmp_name']); $uri = 'data://application/octet-stream;base64,' . base64_encode($binary_data); $arr = getimagesize($uri);
Comments
Post a Comment