Thursday, June 18, 2009

Grails Super File Upload plugin complete and uploaded (mind the pun!)

Ho ho ho

I have uploaded and released my latest Grails plugin

Super File Upload

Finally you can easily style your file upload control and have a fully working progress bar with it.

If you want to see it action then head to my new website www.ebookstamper.com

Enjoy :)

8 comments:

jimmy said...

thanks for your great plugin...

Greg said...

Peter -- Thanks for the great plugin. I am getting a -200 error during upload ... any suggestions ?

Gorbas said...

Is there any way to retrieve the original file name?

Roshan said...

I haven't actually tried your plugin yet, but I seem to recall that the SWFUpload flash component had problems connecting to a "protected" backend Grails controller from FireFox (Worked with IE). A solution was to enable appending JSESSIONID (which is now disabled by default in Grails).

Does this affect the plugin?

Anonymous said...

I have the same query as Gorbas "How can i retrieve the original file name"

Tu Long said...

seems to be very good, but doesnt work with grails 1.2.0.

1. after plugin install you still get: unable to resolve class SuperFileUploadService

2. After picking the image and pressing submit. you get the error: "Error submitting form"

These errors make this plug in unusable ... or is there anything else you should add besides the steps in documentation?

DreamerForever said...

@Tu Long: You need to import it like this first:
import com.solution51.sfu.SuperFileUploadService

If you open the zip package of the plugin you will see that the SuperFileUploadService is in com.solutions51.sfu package :)

Great Plugin, but how to retrieve original file name without too much hacking ??

DreamerForever said...

Gorbas:

You can get the filename if you add another hidden field to the form, I added one with name attribute "filename" and id "#filename"

Just before the upload, you extract the value from swfupload text field to your hidden field...

$("#sbm").click(function(){
var val =$("#swfupload_text").val(); $("#filename").val(val);
});

Now you ca obtain the filename in you controller action with params.filename

Now you have to use the renameTo method in the java.io.File...search jdk.

Hope this helps.