upload file to a webpage

upload file to a webpage

BY 08 May 2015 Web Application Development

Hello

so i’m trying to upload audio file located under media folder

the problem is the request is send but without the audio file

here the code

tizen.filesystem.resolve(
                ‘file:///opt/usr/media/test.aac’
                        ,
                function(dir){
                documentsDir = dir;
                console.log(dir.toURI( ));
                var formData = new FormData();
                formData.append(“__VIEWSTATE”,”p57vGw5amg1TtebFeH1KccQSa93PaFJHyl7wFDHkGfW4jC01N8Fq9SiO21XtO6lAj5p5Nl5YQm3aE8Sq6u+v2gs9arrwbZhWMYuJ1s8VrP0=”);
                formData.append(“FileUploadControl”, dir);
                formData.append(“UploadButton”, “Upload”);
                client.open(“post”, “http://***********”, true);
                client.send(formData);  
                dir.listFiles(onsuccesss, onerrors);
                }, function(e){
                console.log(“Error” + e.message);
                }, “rw”
                );
client.onreadystatechange = function()
{  

   if (client.readyState == 4 && client.status == 200)
   {
       alert(client.responseText);
   }

Written by