java - Uploadify doesn't send filename -


"itemprop =" text ">

I'm trying to use Uploadify for uploading multiple files,

  $ ('# Fileuploadinput'.) Uploadify ({uploader: '/js/uploadify/uploadify.swf', script: '/ uploadpath', cancelImg: '/js/uploadify/cancel.png', multi: true , FileDataName: 'uploadFile'});  

And there is a spring controller with comons-fileupload 1.2.1 on server side.

 for  (org.apache.commons.fileupload.FileItem item: items) {string name = item.getName (); // some other stuff}  

I need to get the original name of the uploaded file, and when using the standard input tag it is fine - name where it should be and Item.getName () returns it back as expected only, however, when Uploadify returns item.getName (), it returns zero. Is there a way to get the name?

A wrapper class

I am using spring MVC, they provide, org.springframework. Web.multipart.multipartfile

You can use the method, getOriginalFilename () to get the file name.

More information can be found from

@RequestMapping (value = "upload", method = RequestMethod.POST) public string processUpload (@RequestParam MultipartFile file, model map model map, HttpServletRequest request) Exceptions thrown {

  log.debug ("= ======= Upload file:" + file.getOriginalFilename ()); }  

Comments

Popular posts from this blog

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -