These forums are read-only and considered to be an archive. Please use the new Community for future interaction and posts.

Uploading Files

Hallo,

I have the following issue:

FileVista sometimes throws an error saying: 
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.

I wanted to try how to upload large files (for example one single file to upload at around 700MB) and then smaller files at around 4MB each. In the last case I tried to upload 60 files and each file had around 3-4MB. 

The error is thrown in line 295 of the file MimeParser.cs and originaly in line 141 of UploadHttpModule.cs.

I am testing the application locally on my development machine, currently not online. I have also tried some changes found in this forum here, for example changing:

httpApplication.PreRequestHandlerExecute += new EventHandler(this.OnPreRequestHandlerExecute);

to 

httpApplication.AcquireRequestState += new EventHandler(this.OnPreRequestHandlerExecute);

but I still get this error sometimes. Do I have to make any changes to the configuration or does thi error occur because my development machine uploads the files with the speed of my hard drive and not with the speed of a normal dsl connection?

Cem, I have sent you an email with an image of the error.

I would be happy to hear from you, soon.

Marco
Marco Beyer 7/27/2009 10:00 PM
Hallo again,

I performed several tests and tried to find the reason for this error. I found that the following line throws the error:

//Check the presence of the first byte of _RequestFilter.MultiPartBoundary2 in the last bytes read                                   
 iPos = Array.IndexOf<Byte>(arrRequestBuffer, _RequestFilter.MultiPartBoundary2[0], iBytesRead - _RequestFilter.MultiPartBoundary2.Length);

Ok, because the error message told me that it was an index out of range, I just commented the array part out to this:

iPos = -1;

The error message is not thrown any longer but sometimes, the upload freezes when uploading large files as well as uploading many large files at one time. By the way: The uploaded files are ok and not corrupted (what I guessed because I commented the array part out).

@Cem or anyone other:

1.) Why does the "Array.IndexOf<Byte>(..." part throw the error?
2.) Could it cause trouble to set iPos simply to -1? Or do you have a solution for me to fix the Array.IndexOf<Byte>(... part?
3.) Is it a known issue that the upload sometimes freezes or what can I do against that (server configuration?)?

Kind regards,
Marco

Marco Beyer 7/28/2009 6:00 AM
Hi Marco,
1. Are you gettting this error when running FileVista on Visual Studio built-in web server? If so it's different than IIS and you shouldn't have this problem when running on IIS.

2. What are the results with Browser uplaod mode. This may be related to Flash upload mode and Adobe Flash version.

3. Do you get the same result with browsers other than IE.

Let me know.
Cem Alacayir 8/10/2009 12:52 PM