Different behavior between IIS 5 and internal webserver of VS.Net 2005

Y

yannis.corre

Hello,

I don't understand the difference of behavior of these two
webservers :
I'm uploading a file and I launch a thread that makes some treatments
with the Request.Files.
I saw that a new .post file was created on a "upload" directory of the
ASP.Net temporary files.

With the internal webserver :
- When I start my thread, I can use the Request.Files (passed by
parameter) perfectly
With IIS 5 :
- When I start my thread, I can't use the Request.Files (passed by
parameter) because the .post file disappears (just when I enter in my
thread).

So I would want to know why the two webservers have two different
behaviors?
How can I do with IIS 5?

Thanks in advance.
 
M

Mark Fitzpatrick

David,
The main difference is the two web servers are completely different
beasts. The test web server that ships with VS is not a great one for heavy
lifting. It was written originally to provide users who have a version of
Windows that doesn't ship with IIS (such as XP Home) an alternative. It is
not based upon the same code and is, I believe, an enhancement of the
Cassini web server that MS released at the ASP.Net web site as a sample way
to integrate the asp.net runtime functionality.
 
Y

yannis.corre

Thanks for your response about the difference.
I understand the difference.

I still have my problem with the .post file in the ASP.Net uploads
temporary files that disappears when I enter in my thread.
I tested the same code in .Net 1.1 and I don't have this problem !
The file doesn't disappear and I can read the Request.files (with
saveas method or by using a binaryreader object to read the file, ...)
Otherwise I have an ObjectDisposedException when I check to read it.
I don't know why my file is deleted and by who?
Is it a bad parameter in IIS 5 or in my web.config?
Thanks...
 
B

bruce barker

unless the main page request delays until the background thread
completes, you have a coding error. as soon as the page request
completes, the class is disposed, and the context (which holds the files
collection) is returned to the pool. the next request will reset the
files collection.

your main thread should clone the files collection (and any other
request values required) before passing to the thread.

-- bruce (sqlwork.com)
 
Y

yannis.corre

Ok, to clone the files.

I try to use this code sample in my webform (just before calling my
thread) :
Array MyArray = Array.CreateInstance(typeof(String),
Request.Files.Count);
Request.Files.CopyTo(MyArray, 0);

The problem is that I have an exception on the CopyTo method
(ArrayTypeMismatchException).
How can I clone my files before calling the thread?

Thanks...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top