Solution to "invalid file name or folder name" prompt when uploading image files in ckfinder IE in Asp.net (original article)

Source: Internet
Author: User

Let's take a look at the differences between ie9 and chrome when uploading files.

In ie, the full path is used, while Chrome is only the file name, resulting in the following error:

 

Solution


Although ckfinder is a commercial code, it is also an open source code. You can use it for demo. The source code directory structure is as follows:

 

 

Find the ckfinder.net. sln file under _ source, open it, and locate the code area shown in.

In the fileuploadcommandhandler. CS class file, locate the code area shown in the figure sendresponse. You can set the breakpoint debugging source code ofile. filename. You will find that, as shown on the interface, in chrome, this value is only the file name, And in IE, It is the full path.

Change the code

Sfilename = path. getfilename (ofile. filename );

 

 

Compile the entire solution. Copy the newly generated ckfinder. DLL to your work project.

Done !!!

If you think the article is useful to you, please "recommend" it. Thank you.

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.