Last post Feb 19, 2014 10:49 PM by chetan.sarode
None
0 Points
1 Post
Feb 19, 2014 02:17 AM|wave0707|LINK
Hello, I have the same problem like http://forums.asp.net/t/1904733.aspx?AjaxFileUpload+s+problem+Version+7+0429+
I use AjaxFileUpload in my webform.
I tried to upload image files.
Some files with Chinese filename and Japanese filename (double-byte character set).
I had tried two ways to build my project.
AjaxFileUpload1.SaveAs(MapPath("~/App_Data/" + file.FileName));
Both projects work fine.
There is a problem after I upload files with 'double-byte character' file name.
It seems ok in upload process.
When I open the file with 'double-byte character' name from "~/App_Data/" folder after I uploaded.
Image application shows "file is damaged".
I had refered from http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AjaxFileUpload/AjaxFileUpload.aspx.
But I didn't find related subjet about the file name encode.
Can you please give me some advices?
Thank you.
*****************************************************************************************************************************************
I just google a demo project. The same code has no problem in AjaxControlToolkit (3.5.60501.0) but it can't open correctly in (4.5.7.1213)
All-Star
52503 Points
15665 Posts
Feb 19, 2014 03:16 AM|oned_gk|LINK
AjaxFileUpload1.SaveAs(MapPath("~/App_Data/" + NewFileName));
Try replace unwanted character from the FileName with blank character or "-" or space as NewFileName.
Sample code :
http://stackoverflow.com/questions/146134/how-to-remove-illegal-characters-from-path-and-filenames
48393 Points
12161 Posts
Feb 19, 2014 10:49 PM|chetan.sarode|LINK
Check out below links
http://stackoverflow.com/questions/2435894/net-how-do-i-check-for-illegal-characters-in-a-path
None
0 Points
1 Post
AjaxFileUpload Error after Upload Files with Double-Byte Character Name
Feb 19, 2014 02:17 AM|wave0707|LINK
Hello, I have the same problem like http://forums.asp.net/t/1904733.aspx?AjaxFileUpload+s+problem+Version+7+0429+
I use AjaxFileUpload in my webform.
I tried to upload image files.
Some files with Chinese filename and Japanese filename (double-byte character set).
I had tried two ways to build my project.
AjaxFileUpload1.SaveAs(MapPath("~/App_Data/" + file.FileName));
Both projects work fine.
There is a problem after I upload files with 'double-byte character' file name.
It seems ok in upload process.
When I open the file with 'double-byte character' name from "~/App_Data/" folder after I uploaded.
Image application shows "file is damaged".
I had refered from http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AjaxFileUpload/AjaxFileUpload.aspx.
But I didn't find related subjet about the file name encode.
Can you please give me some advices?
Thank you.
*****************************************************************************************************************************************
I just google a demo project. The same code has no problem in AjaxControlToolkit (3.5.60501.0) but it can't open correctly in (4.5.7.1213)
All-Star
52503 Points
15665 Posts
Re: AjaxFileUpload Error after Upload Files with Double-Byte Character Name
Feb 19, 2014 03:16 AM|oned_gk|LINK
Try replace unwanted character from the FileName with blank character or "-" or space as NewFileName.
Sample code :
http://stackoverflow.com/questions/146134/how-to-remove-illegal-characters-from-path-and-filenames
Suwandi - Non Graduate Programmer
All-Star
48393 Points
12161 Posts
Re: AjaxFileUpload Error after Upload Files with Double-Byte Character Name
Feb 19, 2014 10:49 PM|chetan.sarode|LINK
Check out below links
http://stackoverflow.com/questions/146134/how-to-remove-illegal-characters-from-path-and-filenames
http://stackoverflow.com/questions/2435894/net-how-do-i-check-for-illegal-characters-in-a-path
Team Lead, Product Development
Approva Systems Pvt Ltd, Pune, India.