vis*_*ssu 7 javascript file-upload image
我需要从javascript上传图像到web服务.我必须发送一个json字符串文件(图像).在java中我们有MultipartEntity.我在java中有以下代码:  
HttpPost post = new HttpPost( aWebImageUrl2 );
MultipartEntity entity  = new MultipartEntity( HttpMultipartMode.BROWSER_COMPATIBLE );
// For File parameters
entity.addPart( "picture", new FileBody((( File ) imgPath )));
// For usual String parameters
entity.addPart( "url", new StringBody( aImgCaption, "text/plain", Charset.forName( "UTF-8" )));
post.setEntity( entity );  
现在我需要在javascript中进行相同的图片上传.
但是在javaScript中我找不到任何相当于MultipartEntity的东西.请建议任何解决方案.
对于上传图像,我使用Valum 的 ajax 上传插件或允许以 ajax 方式提交普通表单的jQuery 表单插件。
如果您将使用 POST 请求,请不要忘记使用 MAX_FILE_SIZE 隐藏属性:
<input type="hidden" name="MAX_FILE_SIZE" value="20000000">
请注意,它必须位于文件输入字段之前。它以字节为单位,因此这会将上传限制为 20MB。有关详细信息,请参阅PHP 文档。