fckeditor 0.8 插件在 Grails 1.0.4 中的bug
据说这个bug仅仅会在 Grails 1.0.4 中出现,有人建议直接使用 1.0.5 的预览版本,不过我看到 1.1 beta2 已经发布了,看来用不了再等多长的时间了。
修改文件 GRAILSAPP/plugins/fckeditor-0.8/grails-app/controllers/FckeditorController.groovy
在最后面,大概是 264 行附近开始,把如下一段:
def file = multiRequest.getFile("NewFile")
if (!file) {
errorNo = Fckeditor.ERROR_CUSTOM
errorMsg = "INVALID FILE"
}
else {
errorNo = Fckeditor.ERROR_NOERROR
newName = file.originalFilename
def f = splitFilename( newName )
if (isAllowed(f.ext, type)) {
def fileToSave = new File( finalDir, newName )
if ( !overwrite ) {
def idx = 1
while ( fileToSave.exists() ) {
errorNo = Fckeditor.ERROR_FILE_RENAMED
newName = "${f.name}(${idx}).${f.ext}"
fileToSave = new File( finalDir, newName )
idx++
}
}
file.transferTo( fileToSave )
}
else {
errorNo = Fckeditor.ERROR_INVALID_FILE_TYPE
errorMsg = "INVALID FILE TYPE"
}
}
替换为:
def file
if (ServletFileUpload.isMultipartContent(request)) {
FileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
List /* FileItem */ items = upload.parseRequest(request);
file = items.find {
!it.isFormField() && 'NewFile' == it.fieldName
}
}
if(file) {
errorNo = Fckeditor.ERROR_NOERROR
newName = String.valueOf(System.currentTimeMillis())+'.'+FilenameUtils.getExtension(file.name)
def f = splitFilename( newName )
if (isAllowed(f.ext, type)) {
def fileToSave = new File( finalDir, newName )
if ( !overwrite ) {
def idx = 1
while ( fileToSave.exists() ) {
errorNo = Fckeditor.ERROR_FILE_RENAMED
newName = "${f.name}(${idx}).${f.ext}"
fileToSave = new File( finalDir, newName )
idx++
}
}
file.write( fileToSave )
}
else {
errorNo = Fckeditor.ERROR_INVALID_FILE_TYPE
errorMsg = "INVALID FILE TYPE"
}
} else {
errorNo = Fckeditor.ERROR_CUSTOM
errorMsg = "INVALID FILE"
}
Comments
I'm so happy to read this. This is the kind of manual that needs to be given and not the random misinformation that is at the other blogs. Appreciate your sharing this best doc.
Posted by: strony internetowe RzeszĂłw | December 22, 2011 5:14 PM
WikiLeaks is an planetary new media non-profit social group that publishes submissions of otherwise unavailable documents from unknown news sources and news leaks. Its website, launched in 2006, is run by The Sunshine Press. Within a year of its launch, theinternet site claimed its information had grown to more than 1.2 million documents. The organisation has described itself as having been founded by Chinese dissidents, as well as journalists, mathematicians, and start-up company technologists from the United States government, Taiwan, EU, Australia, and South Africa. Julian Assange, an Australian Internet activist, is specificallydescribed as its supervisor.
Posted by: e liquids kaufen | March 2, 2012 5:16 PM
Jolynn, I've seriously appreciated having your Special Report to guide me correct along step by step as I make my Squidoo Lens. I'd like to say thanks for taking your time to create and share this with us. Keep up the excellent get the job done! I are unable to wait until the sequel.
Posted by: Maxine Panell | August 10, 2012 7:32 PM
I had a lot of fun at Interface. They are extremely professional. I already had couple of calls and auditions!!!
Posted by: Parker Kahanaoi | August 10, 2012 7:44 PM
Hi there. Very nice website!! Guy .. Excellent .. Amazing .. I will bookmark your site and take the feeds additionally...I'm happy to locate a lot of helpful info right here within the post. Thanks for sharing...
Posted by: porn | September 21, 2012 5:11 PM
Hi there. Very cool website!! Man .. Beautiful .. Superb .. I'll bookmark your blog and take the feeds also...I am satisfied to find a lot of helpful information here in the post. Thanks for sharing..
Posted by: Mejores restaurantes marbella | September 22, 2012 4:43 PM
I always was interested in this subject and still am, thanks for putting up.
Posted by: perth web design | September 24, 2012 5:44 PM
I reckon something really special in this internet site.
Posted by: plastic strapping | September 24, 2012 5:56 PM
I love your wordpress theme, where did you get a hold of it from?
Posted by: Follow This Link | September 25, 2012 8:08 PM
You have ended approximately clothed points near. I checked proceeding the web to learn more concerning the deliver and found most inhabitants will chance next to with your views on this site.
Posted by: utorrent | September 30, 2012 12:41 AM
I bring into being so a lot of motivating gear in your blog specially its discussion. As of the tons of comments by your articles, I suppose I am not the only one having all the enjoyment here! keep in the lead the clear work.
Posted by: photoshop | October 1, 2012 9:26 AM
Really safe in order can be originate taking place web blog .
Posted by: nero | October 2, 2012 10:43 AM
Hi! A big cheese in my Facebook congregate collective this site with us accordingly I came to check it out. I'm certainly loving the information. I'm bookmarking and will be real twittering this to my followers! Admirable blog and excessive design.
Posted by: nero | October 2, 2012 9:39 PM
With all that window glass in that baby, I am confident among the occupants could be a fully functional "side check out mirror". Why mess with it up with somethin' that in all probability was not needed inside a vehicle like that? This can be my first chance to find out the Scarab lookin' like it just rolled from the assembly line. All I am able to say is task well carried out in her restoration, and kudos into the owners who appeared to own kept her as original as you can. Owing to the owners for your address to obtain to check out her!
Posted by: Isaac Ruhoff | October 6, 2012 2:55 PM
You have brought up a very great points , thankyou for the post. "The great object is, that every man be armed. ... Every one who is able may have a gun." by Patrick Henry.
Posted by: fun mobile learning | October 7, 2012 2:54 PM
I dugg some of you post as I thought they were very useful invaluable|
Posted by: Julia Bond | October 8, 2012 6:47 PM
Dead serene written pleased, merit for selective in rank. "The earth was ended cycle thus we would not spot very much consume the road." by Karen Blixen.
Posted by: gry | October 10, 2012 11:45 AM
Hello, i really enjoy viewing your blog. I like the way its layd out, and totally dig the topic. Is there any way to subscribe to your site?
Posted by: Cute Tranny | October 12, 2012 9:48 PM
Hello, i really enjoy following your blog. I like the way its put together, and totally dig the topic. Is there any way to subscribe to your site?
Posted by: related site | October 13, 2012 6:04 PM
yesss very thanks man i love this site
Posted by: Look Here | October 17, 2012 4:16 PM
Hello, i really enjoy following your blog. I like the way its put together, and totally dig the topic. Is there any way to subscribe to your site?
Posted by: shemale wiki | October 21, 2012 10:02 AM
The place was the individual responsible for roundin' all those voters up~?
Posted by: Efren Bedient | October 21, 2012 12:37 PM
Hello, i really enjoy visiting your blog. I like the way its written, and totally dig the design. Is there any way to subscribe to your site?
Posted by: Izabella Lobos & Andre | October 23, 2012 9:53 AM
What was the price on the Bell rocket motor? Contact facts?
Posted by: Dania Couse | October 28, 2012 7:49 PM
Thanks , I have recently been looking for info about this topic for ages and yours is the best I've discovered so far. But, what about the bottom line? Are you sure about the source?
Posted by: kalendarz | October 31, 2012 9:42 AM
whoah this blog is excellent i love reading your posts. Keep up the great work! You know, many people are hunting around for this information, you could aid them greatly.
Posted by: skype | November 4, 2012 1:59 PM
I’m delighted that I had the opportunity to visit this blog and spread my horizons. However you ever thought that we at this time put our focus way to much on elements which just dont really matter, like my partner secretly surfing on Slightly Dressed Women Photography He is convinced i would certainly not really know it, but i do! But back to subject .. Right behind our back our governments conspiring for the next big world war, lowering our legal rights down, and throwing away our tax $. We must step back a little bit from unproductive internet sites and study more alterative news media like f.e. prisonplanet.com , naturalnews.com or infiniteunknown.net - I believe that We Are The People, and we ought to call for action and impose the change to the best of the people!
Posted by: BurstNET Server | November 4, 2012 10:15 PM
You need to be a part of a contest for one of the highest quality blogs on the web. I'm going to highly recommend this blog!
Posted by: ghdflghkdfs | November 5, 2012 8:17 AM
Love this website. Do you ever share this information on facebook?
Posted by: Zaida Kordish | November 7, 2012 5:43 PM
Hello, i really like visiting your blog. I like the way its put together, and totally dig the concept. Is there any way to follow your site?
Posted by: shemales | November 8, 2012 5:38 AM
There will one day spring from the brain of science a machine or force so fearful in its potentialities, so absolutely terrifyin
Posted by: Darcy Avolio | November 8, 2012 9:54 PM
I am glad to be one of several visitors on this great site (:, thank you for putting up.
Posted by: Janene Lobach | November 10, 2012 4:04 AM
I genuinely enjoy looking at on this website , it has got excellent posts .
Posted by: audiogram | November 13, 2012 11:03 AM
Loving the info on this website , you have done great job on the posts .
Posted by: forex | November 14, 2012 7:26 AM
What a lovely day for a 1961725! SCK was here
Posted by: 1961725 | November 14, 2012 2:05 PM
I have recently started a web site, the info you offer on this website has helped me greatly. Thanks for all of your time & work.
Posted by: grzejniki panelowe sklep | November 15, 2012 1:56 PM
My husband, a war veteran, and I are EXTREMELY offended that the US Census chose to list "Hispanic" origin in a priority position on the questionaire, before all other races. First, if you're Hispanic, second...are you any other race.
We're mad as H*** about everything in this country being centered around Hispanics!!!!!!!!!!!! How about listing ALL races, in alphabetical order, or at the very least, prioritizing the American Indian in first place???
If this was a Mexico Census or Cuba Census, we would expect this question to be listed first. However, this is a US CENSUS why are Mexicans listed first???? We're sick of this racist and biased prioritizing covered under the blanket of "US Census".
Posted by: Amarante | November 23, 2012 2:28 AM
Isn't it about time to move the denver Regional Office to Phoenix? Phoenix is by far the largest city in the region and much more of a dynamic metro center.
Posted by: Amarante | November 23, 2012 6:04 PM
So good to know that the students will be counted in one or the other places. But "traditional fare like turkey and dressing"? to whom?
Posted by: Aleron | November 26, 2012 9:19 AM
"wow, awesome post.Really planning to read more. Really Cool."
Posted by: Merlyn Knore | November 28, 2012 3:05 AM
As soon as I found this site I went on reddit to share some of the love with them.
Posted by: onager | November 29, 2012 12:02 PM
I am really appreciative for the post. Awesome.
Posted by: Gustavo Sam | November 30, 2012 9:11 AM
Libby Houston~ Weve removed the ceiling above our dreams. There are no more impossible dreams.
Posted by: Penni Niesporek | November 30, 2012 1:53 PM