class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
I went through this class, and it seems nice, but I need to avoid flash, in order to be Iphone compliant :(
Then I found this: http://www.dhtmlx.com/docs/products/dhtmlxVault/index.shtml (Full ajax uploader)
Here is their PHP code:
$id = $_GET['sessionId'];
$id = trim($id);
session_name($id);
session_start();
$inputName = $_GET['userfile'];
$fileName = $_FILES[$inputName]['name'];
$tempLoc = $_FILES[$inputName]['tmp_name'];
echo $_FILES[$inputName]['error'];
$target_path = 'uploads/';
$target_path = $target_path . basename($fileName);
if(move_uploaded_file($tempLoc,$target_path)) // here they are just moving the file from the tmp directory to the new
And here is what I did:
include('class.upload.php');
$id = $_GET['sessionId'];
$id = trim($id);
session_name($id);
session_start();
$inputName = $_GET['userfile'];
$fileName = $_FILES[$inputName]['name'];
$tempLoc = $_FILES[$inputName]['tmp_name'];
$target_path = 'uploads/';
// ---------- IMAGE UPLOAD ----------
$handle = new Upload($tempLoc); // Processing the file from the tmp directory -> is that OK?
if ($handle->uploaded) {
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_x = 300;
$handle->Process($target_path);
// we check if everything went OK
if ($handle->processed) {
// everything was fine !
$_SESSION['dhxvlt_state'] = -1;
} else {
// one error occured
$_SESSION['dhxvlt_state'] = -3;
}
}
I went through this class, and it seems nice, but I need to avoid flash, in order to be Iphone compliant :(
Then I found this:
http://www.dhtmlx.com/docs/products/dhtmlxVault/index.shtml
(Full ajax uploader)
Here is their PHP code:
And here is what I did:
But that's not working...
Any idea?
THANKS!!!