FCKeditor resolution upload Chinese name pictures appear garbled problem (for ASP)

Source: Internet
Author: User
Tags end modify
Solution | upload | question | Chinese |fckeditor

FCKeditor resolution upload Chinese name pictures appear garbled problem (for ASP)

This example is only applicable to the code changes under ASP, other languages can be modified by this article to modify the relevant file code.

Outside: In fact, FCKeditor itself should provide a similar fckconfig.autosave parameters for everyone to choose whether to automatically name the upload file or the original file name upload function, I hope that the next version can be achieved:

OK, get to the point, in the ASP implementation FCKeditor upload picture automatic naming function is very simple, there are only two steps:

1, modify the commands.asp in the editor\filemanager\connectors\asp directory

Found it
Sextension = Ouploader.file ("NewFile"). Ext
sFileName = Sanitizefilename (sfilename)
Modified to:sFileName = getnewfilename& "." &sextension

2, modify the io.asp in the editor\filemanager\connectors\asp directory

Add a function at the bottom of the program to automatically name the files uploaded by FCKeditor:

Function Getnewfilename ()
Dim rannum
Dim Dtnow
Dtnow=now ()
Rannum=int (90000*RND) +10000
Getnewfilename=year (Dtnow) & Right ("0" & Month (Dtnow), 2) & Right ("0" & Day (Dtnow), 2) & Right ("0" ; Hour (Dtnow), 2 & Right ("0" & Minute (Dtnow), 2) & Right ("0" & Second (Dtnow), 2) & Rannum
End Function

Just copy the above code and paste it up on the OK. Remember before the end of the%> symbol AH (with ASP experience will not have to see)



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.