arndta / TinyFileManager.NET

A file manager plugin for TinyMCE v4
28 stars 20 forks source link

File Upload Path Issue with IE #17

Open nameofperson opened 9 years ago

nameofperson commented 9 years ago

Hello!, I've been currently implementing your file manager and I love it, but there's an issue with the upload functionality when used in IE. Specifically, when the application tries to save the uploaded file, the user will receive an error like "The given path's format is not supported". Drilling down on the source code, the problem starts when the application generates the file save target destination:

strTargetFile = this.objConfig.strUploadPath + this.strFolder + filUpload.FileName.ToLower();

On IE, filUpload.FileName does not translate to the direct file name, but rather to the full upload path from the user side: (Mozilla) mozilla

(IE) ie

I solved it locally by wrapping the call from filUpload.FileName to Path.GetFileName(filUpload.FileName) and it now works, so I thought I'd let you know in case anyone else gets the same issue.

Love your work, thank you very much!

arndta commented 9 years ago

Good catch, thanks! On Jun 9, 2015 11:09 AM, "nameofperson" notifications@github.com wrote:

Hello!, I've been currently implementing your file manager and I love it, but there's an issue with the upload functionality when used in IE. Specifically, when the application tries to save the uploaded file, the user will receive an error like "The given path's format is not supported". Drilling down on the source code, the problem starts when the application generates the file save target destination:

strTargetFile = this.objConfig.strUploadPath + this.strFolder + filUpload.FileName.ToLower();

On IE, filUpload.FileName does not translate to the direct file name, but rather to the full upload path from the user side: (Mozilla) [image: mozilla] https://cloud.githubusercontent.com/assets/6987038/8062696/b3a91778-0e96-11e5-90d8-8ed1faa8e592.png

(IE) [image: ie] https://cloud.githubusercontent.com/assets/6987038/8062704/bb108582-0e96-11e5-80f9-47a15fd09ccb.png

I solved it locally by wrapping the call from filUpload.FileName to Path.GetFileName(filUpload.FileName) and it now works, so I thought I'd let you know in case anyone else gets the same issue.

Love your work, thank you very much!

— Reply to this email directly or view it on GitHub https://github.com/arndta/TinyFileManager.NET/issues/17.