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)