This project is read-only.

FileManager Upload Issue

Oct 6, 2007 at 10: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 11: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 7, 2007 at 12:14 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Oct 7, 2007 at 12:16 AM
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 7, 2007 at 12:24 AM
I think it might not work with multiple files. Try this instead:

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