FileManager Upload Issue

Oct 6, 2007 at 9:47 PM
hi there,
can you tell me if i need to configure the site in any way to permite file uploads?

i have tried the runtime for 1.2.5 and the example site and neither of them seem to upload files properly.

The path seems to be incorrect:
Exception Details: System.Web.HttpException: '/Upload/C:\Documents and Settings\Administrator\Desktop\addtocart_rest.gif' is not a valid virtual path.

It seems to work in 1.2.1

Oct 6, 2007 at 10:04 PM
i modified the default.aspx.cs file in the /FileManager/ folder to fix this problem
changing the line:
string url = SelectedUrl + "/" + file.FileName;
string url = SelectedUrl + "/" + fileUpload.FileName;

so that it actually just grabs the file name and not the full path to the file. given that you allow multiple uploads though im not sure this is a good solution?
Oct 6, 2007 at 11:14 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Oct 6, 2007 at 11:16 PM
This is probably a bug. I think the file.FileName property differs between firefox and explorer and I must have missted it. Thanks for finding it.

Oct 6, 2007 at 11:24 PM
I think it might not work with multiple files. Try this instead:

string url = SelectedUrl + "/" + Path.GetFileName(file.FileName);