<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Is that JavaScript on a static page or is it generated by Seaside? I would suggest writing your jQuery with the Seaside package. That way, you can just call a method on your WAComponent and receive the data that way.<div><br></div><div>http://demo.seaside.st/javascript/jquery</div><div><br></div><div>RS<br><br><div><div id="SkyDrivePlaceholder"></div>> Date: Fri, 22 Feb 2013 09:28:31 -0800<br>> From: unseokyeo@gmail.com<br>> To: seaside@lists.squeakfoundation.org<br>> Subject: [Seaside] Multiple file upload with jquery ajax and FormData<br>> <br>> Hi Smalltalkers,<br>> <br>> I am an absolute newbie to smalltalk (and seaside) in need of your great<br>> wisdom on file upload.<br>> <br>> What I am trying to do is allow users to drag a file (or files) from their<br>> desktop and drop it to a <div> tag to trigger file upload. I have it<br>> working with php but not sure how to translate this to *smalltalk way*.<br>> <br>> On the browser side I am doing the following using javascript (and jquery):<br>> 1. preventDefault() on both 'dragover' and 'drop' to prevent browser from<br>> opening the file on drag and drop.<br>> 2. append each file to FormData :<br>> <br>> for (filename in filelist) {<br>> formData.append(filename, filelist[filename]);<br>> }<br>> <br>> 3. Then fire an ajax call with formData:<br>> <br>>         $.ajax({<br>>                 *url: 'php/fileupload.php'*,<br>>                 data: formData,<br>>                 processDate: false,<br>>                 contentType: false,<br>>                 type: 'POST',<br>>                 success: function(data) {<br>>                         alert("File upload completed");<br>>                         removeAll();<br>>                 },<br>>                 error: function(a, b, c) {<br>>                         alert("Error: " + c);<br>>                 }<br>>         });<br>> <br>> But, I am lost when it comes to target url (in red) for this ajax request.<br>> <br>> On the server side, I have a simple php that handles the request:<br>> <br>> <?php<br>> foreach ($_FILES as $filename => $file) {<br>> if ($_FILES[$filename]["error"] > 0) {<br>> echo "Error: " . $_FILES[$filename]["error"];<br>> } else {<br>> move_uploaded_file($_FILES[$filename]["tmp_name"], "upload/" .<br>> $_FILES[$filename]["name"]);<br>> }<br>> }<br>> ?><br>> <br>> Your help will be greatly appreciated.<br>> <br>> <br>> <br>> Un-Seok<br>> <br>> <br>> <br>> --<br>> View this message in context: http://forum.world.st/Multiple-file-upload-with-jquery-ajax-and-FormData-tp4671533.html<br>> Sent from the Seaside General mailing list archive at Nabble.com.<br>> _______________________________________________<br>> seaside mailing list<br>> seaside@lists.squeakfoundation.org<br>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside<br></div></div>                                            </div></body>
</html>