Yep
It's a bit tricky, but once you got the idea, it's pretty simple.

<?php
if(!empty($_FILES['file']['name']))
{
        $destination_folder = "./your_folder_to_upload_in/";

        // remove all not url friendly caracters, and add a datetime prefix to 
avoid any file replacement
        $file_name = date('YmdHis') . '-' .preg_replace("/[^a-zA-Z0-9.]+/", "", 
strtolower(basename($_FILES['file']['name'])));

        // copy the uploaded file from the server temp folder to the folder and 
filename you set
        if (move_uploaded_file($_FILES['file']['tmp_name'], 
$destination_folder.$file_name))
                echo $file_name;
        else
                echo 'error : upload failed';
}
else
        echo 'error : no file to upload';
?>


Le 14 oct. 2013 à 17:02, Reenen Laurie <[email protected]> a écrit :

> On Wednesday, 2 October 2013 19:03:25 UTC+2, Remi Grumeau  wrote:
>> This is a proof of concept for mobile webapp file upload.
>> http://emy-library.org/sandbox/fileupload/
>> 
> 
> Hi Thanks Remi,
> 
> Could you post the contents of ajax_upload.php as I think that is really the 
> part where I am struggling. 
> 
> Regards,
> -Reenen
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "iPhoneWebDev" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/iphonewebdev.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/iphonewebdev.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to