Java – GWT fileUpload, file not sent in post
I'm trying to use GWT 2.4 gwtupload 0.6 4 library upload a simple file
This is my dialog UI Relevant parts of XML:
<g:Dialog@R_48_2419@ modal="true" width="400px" height="150px"> <g:caption><ui:msg>Import new..</ui:msg></g:caption> <g:VerticalPanel styleName="full-width"> <g:InlineLabel styleName="formlabel"><ui:msg>File name</ui:msg></g:InlineLabel> <up:Uploader ui:field="uploader" validExtensions="zip" styleName="uploader full-width"> </up:Uploader> <g:Button styleName="button" ui:field="importButton" enabled="true"> <ui:msg>Import</ui:msg> </g:Button>
Importbutton finally calls uploader submit(). My problem is that I press the button for the first time and send an empty post to the server, and then I receive an error message If I press the button for the second time, my file is in post If I close the dialog and start over, the same thing will happen Every import attempt after the first one is OK
This is an empty post example:
Content-Type: multipart/form-data; boundary=---------------------------9003259118762 Content-Length: 46 -----------------------------9003259118762--
I tried to click the button again as a solution However, if I catch the error message I receive and call uploader again Submit () or even call it from the timer () callback, it won't work like the second time I click with the mouse
What do you think? May there be something wrong?
Solution
The solution is uploader Some lines after submit () have an uploader Setenabled (false) call After deletion, the uploader starts to work normally
The above is the Java – GWT fileUpload collected by programming house for you. The file is not sent in post. I hope this article can help you solve the program development problems encountered by Java – GWT fileUpload and the file is not sent in post.
If you think the content of the programming home website is good, you are welcome to recommend the programming home website to programmers and friends.