Thanks for the tip Lukas. Now I have access to the right value using:<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; html paragraph: [ <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; html fileUpload<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; name: &#39;file&#39;;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; onChange: (html jQuery ajax<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; callback: [ :value | self handleNewFile: value ] value: (html jQuery this value))].<br><br>But for me this is only half the solution. Based on that value I need to update the values of some hidden input fields in the same form. How can I add the ajax update in the same onChange code?<br>
<br>As part of the Cloudfork project I am building some Seaside components that let you upload data directly to an Amazon S3 bucket (<a href="http://docs.amazonwebservices.com/AmazonS3/2006-03-01/index.html?UsingHTTPPOST.html">http://docs.amazonwebservices.com/AmazonS3/2006-03-01/index.html?UsingHTTPPOST.html</a>). I already have a plain non-ajax version working. Now I&#39;m busy with &quot;ultimate AJAX S3 upload form&quot;. The idea is:<br>
<br>1 developer configures upload component with his aws access keys, bucket name etc.<br>2 when a user select a file the component receives a callback. in this callback he can check whether the file type is allowed and set other S3 upload parameters like the Content-Type.<br>
3 when the user presses submit i want to submit the form using ajax and show a &quot;please be patient...&quot; message while the upload is in progress<br>4 when the upload is done S3 returns an XML document with success or error information, this should be translated to a user information message<br>
5 and it should be possible to have multiple instances of this component present on a single webpage so multiple uploads can run in paralell.<br><br>Jan.<br><br><br><br>&nbsp;<br><br><br><br><div class="gmail_quote">On Wed, Jan 14, 2009 at 5:39 PM, Lukas Renggli <span dir="ltr">&lt;<a href="mailto:renggli@gmail.com">renggli@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">&gt; Currently the fileUpload code looks like this:<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; html paragraph: [<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; html fileUpload<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; id: (uploadId := html nextId);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name: &#39;file&#39;;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onChange: ((html jQuery id: &#39;pid&#39;) load<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addParameter: &#39;dummy&#39; -&gt; ((html jQuery id: uploadId)<br>
&gt; value);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; html: [ :h | self hanldeNewFile: h. h text: &#39;Haai&#39;<br>
&gt; ])].<br>
<br>
</div>File uploads and Javascript are hairy. You cannot easily serialize a<br>
file and submit it through an AJAX request, due to security<br>
restrictions in JavaScript. Some sites use a little IFRAME to be able<br>
to make a traditional submit without having a full refresh of the<br>
complete page. Other sites use a Flash or Java applet. Have a look at<br>
the JQuery Plugins<br>
(<a href="http://plugins.jquery.com/search/node/upload+type%3Aproject_project" target="_blank">http://plugins.jquery.com/search/node/upload+type%3Aproject_project</a>),<br>
there are quite a few providing different solutions to this problem.<br>
<div class="Ih2E3d"><br>
&gt; Can anobody tell me how I can read the parameter value from the callback<br>
&gt; block?<br>
<br>
</div>#addParameter: is a low level function. It modifies the URL.<br>
<br>
Use #callback:value: instead, this is the high level interface. It<br>
expects a block that will be evaluated with the evaluation of the<br>
Javascript object given as a second parameter. Look at the senders of<br>
this method to see some examples.<br>
<br>
Cheers,<br>
Lukas<br>
<font color="#888888"><br>
--<br>
Lukas Renggli<br>
<a href="http://www.lukas-renggli.ch" target="_blank">http://www.lukas-renggli.ch</a><br>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</font></blockquote></div><br>