Recently encountered a demand, need to upload audio files, the server use WebService through Spring3 file upload. After the code is finished using HTML to request the interface through post, but do not know how to use the Fiddler2 tool for simulation testing, after some efforts to finally succeed, here to share!
Spring3 File Upload open for reference: http://blog.csdn.net/maotongbin/article/details/11921329
1. Open the Fiddler2 tool and fill in the necessary information
2. Click the Upload file button to upload the files
3. This will allow you to simulate file uploads! Here's a key point to make, don't forget to change "Fieldnamehere" to the name of the field in the code that receives the stream!
4. There will also be friends concerned about if you need to upload the same time and other parameters to do? Please see:
5. Finally, share your own exploration process.
The Firebug tool is used here to upload files using the HTML analog post
<Body> <formAction= "HTTP://LOCALHOST:8080/OPSERVERTEMP/DIYCRBT/AUDIODIYCRBT"Method= "POST"enctype= "Multipart/form-data" >ringname<inputtype= "text"name= "Ringname"value= "My Ringtone"><BR/> <BR/>Format<inputtype= "text"name= "format"value= "1"><BR/> <BR/>Apiversion<inputtype= "text"name= "Apiversion"value= "1.0"><BR/> <BR/>Audio<inputtype= "File"name= "Audio"><BR/> <BR/> <inputtype= "Submit"value= "Submit"> </Body>
The Firebug tool lets you see what's uploaded.
We see that the header information here is similar to the header information of the Fiddler2 simulation.
Continue to view the Post tab
Scroll down and look at the source code section, and it will come to an epiphany!
Fiddler2 Analog File Upload