Advertisement

05.26.2007 at 08:54AM PDT, ID: 22596392 | Points: 125
[x]
Attachment Details

HTTP Server, Cancel POST request

Tags: cancel, request, post, http
Hi,

I'm developing a HTTP server that can receive files through standard POST forms, that is an HTML page with a form where the user can select a file, and then press an Upload button and it will be sent to the server in multipart/form-data format, so uploading can be done from Internet Explorer or any other browser that supports these kind of forms. This works fine, however I don't want to allow clients to replace already existing files on the server, but rather receive an error response when uploading a file with the same name as an existing file. This also works fine, I simply reply with a 403 Forbidden  "The file you tried to upload already exists" after receiving the data for an existing file.

My problem arises when the user for example sends a 100 MB file, that takes several minutes to upload. Once I detect that the filename exists on the server, I want to immediately respond with the error message, and not receive the entire file. When I try to do this the browser I'm testing with, which is Internet Explorer on Windows XP, seems to ignore the response, and tries to continue to send the file in question. Closing the connection on the server makes the browser to reconnect (according to the HTTP spec. recommendations) and resend the file. Disconnecting again makes the browser display a "failed" message, but not my response message.

I've looked through the HTTP 1.1 specification searching for a supported way to do what I want, but I haven't found any. Is there a defined way in the protocol to abort such requests?
Or is this not possible according to the standard, and I must rely on a client that has some extra built-in support for this behaviour?

Thanks
/Erik
Start your free trial to view this solution
Question Stats
Zone: Networking
Question Asked By: GoSuGyS
Question Asked On: 05.26.2007
Participating Experts: 3
Points: 125
Views: 0
Translate:
Loading Advertisement...
05.29.2007 at 04:22PM PDT, ID: 19176310

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.29.2007 at 05:23PM PDT, ID: 19176541

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.30.2007 at 08:50AM PDT, ID: 19181042

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.31.2007 at 01:00AM PDT, ID: 19186192

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.08.2008 at 08:59AM PST, ID: 20610309

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080236-EE-VQP-29