1

I have coded up a servlet that I'll be using to process file uploads with Uploadify. Uploadify provides a "Script" section in its implementation, where by default it points to a pre-packaged Upload.php to process file uploads. Obviously, I will not be able to use this since I'm in Java world.

I'd like to know what the syntax would look like where I link Uploadify to my servlet. See below for Uploadify's link to its PHP file in bold. What would this line look like pointed to a servlet instead of PHP file?

$(document).ready(function() {
  $('#file_upload').uploadify({
    'uploader'  : '/uploadify/uploadify.swf',
    **'script'    : '/uploadify/uploadify.php',**
    'cancelImg' : '/uploadify/cancel.png',
    'folder'    : '/uploads',
    'auto'      : true
  });
});
curiousgeorge
  • 1,183
  • 4
  • 14
  • 22

1 Answers1

1

Just let the URL point to a servlet which in turn parses the request as you would usually do in case of an <input type="file"> field. A defacto standard of parsing uploaded files is the Apache Commons FileUpload. You can find examples in their User Guide section.

You can find a more concrete example of a Servlet which acts on Uploadify requests in the "Update" section of this answer.

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • A servlet **is** a Java class. It look like that you're new to servlets as well. I'd suggest to get yourself through our [servlets info page](http://stackoverflow.com/tags/servlets/info) to get started with servlets. – BalusC Feb 28 '11 at 16:51