Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Incorrect http form parsing problem....

Reply
Thread Tools

Incorrect http form parsing problem....

 
 
Dan Corkum
Guest
Posts: n/a
 
      01-20-2005
Good morning. I am working on an issue that is just baffling me. I have
developed an .aspx page that receives an http form post that has a "file"
attribute.

When I do testing with a test post page, everything functions properly. When
the actual customer does the post, the attribute following the "file"
attribute is concatenated to the file itself. When I execute the
HttpPostedFile.SaveAs(), the resulting file is what is sent Plus the
following form attribute. This following attribute is not in any Collection
from the Request object.

Here is how I log the http post;

//Log the post sent
buf = new byte[Request.InputStream.Length];
Request.InputStream.Read(buf, 0, buf.Length);
char[] asciiChars = new char[Encoding.ASCII.GetCharCount(buf, 0, buf.Length)];
Encoding.ASCII.GetChars(buf, 0, buf.Length, asciiChars, 0);
FileUtils.getInstance().Log( "Stream:[" + new String(asciiChars) + "]");

This is the resulting log;

--------------CaminusWebExchange32MultiPartPOSTBoundary110609198 5
Content-disposition: form-data; name="from"

030353283
--------------CaminusWebExchange32MultiPartPOSTBoundary110609198 5
Content-disposition: form-data; name="to"

TERMOMEXI
--------------CaminusWebExchange32MultiPartPOSTBoundary110609198 5
Content-disposition: form-data; name="input-format"

x12
--------------CaminusWebExchange32MultiPartPOSTBoundary110609198 5
Content-disposition: form-data; name="input-data";
filename="ProcessLog.14404.log"
Content-Type: application/octet-stream

ISA*00* *00* *01*030353283 *01*TERMOMEXI
*050118*1546*U*00304*000014407*1*T*~
GS*CA*G865SQTS*TERMOMEXISQTS*050118*1546*000014407 *X*003040
ST*865*000014407
BCA*00**1***050118
DTM*102*****DT*200501181546
N1*78**1*TERMOMEXI
N1*SJ**1*030353283
POC*-1*OC******CR*A004F1*MN*T
DTM*007*****RD8*20040930-20040930
SLN*1**I*20000.000000*BZ
SI*AP*TT*01*PG*Default*UK*N/A*R2*1*R3*1*DK*N/A
PO3*ZZ*****19830.000000*BZ
N1*M2**29*301068
N1*MQ**29*336408
N1*DW**1*N/A
N1*US**1*N/A
SLN*2**I*15000.000000*BZ
SI*AP*TT*01*PG*Default*UK*N/A*R2*1*R3*1*DK*N/A
PO3*ZZ*****14872.000000*BZ
N1*M2**29*EHR MC
N1*MQ**29*336408
N1*DW**1*N/A
N1*US**1*N/A
POC*-1*OC******CR*A004F1*MN*U
DTM*007*****RD8*20040930-20040930
SLN*1**I*34702.000000*BZ
SI*AP*TT*01*PG*Default*UK*N/A*R3*1*DK*TEXTEST*RR*N/A
N1*MQ**29*336408
N1*DW**1*TERMOMEXI
N1*US**1*N/A
SLN*2**I*15000.000000*BZ
SI*AP*TT*01*PG*Default*UK*A009MC*R2*1*DK*N/A*RR*N/A
N1*M2**29*EHR MC
N1*DW**1*N/A
N1*US**1*067271981
SLN*3**I*20000.000000*BZ
SI*AP*TT*01*PG*Default*UK*97HH*R2*1*DK*N/A*RR*N/A
N1*M2**29*301068
N1*DW**1*N/A
N1*US**1*067271981
CTT*2
SE*000000040*000014407
GE*1*000014407
IEA*1*000014407
--------------CaminusWebExchange32MultiPartPOSTBoundary110609198 5
Content-disposition: form-data; name="transaction-set"

G865SQTS
--------------CaminusWebExchange32MultiPartPOSTBoundary110609198 5
Content-disposition: form-data; name="batch-id"

23
--------------CaminusWebExchange32MultiPartPOSTBoundary110609198 5--



But this is the file that is saved when I execute HttpPostedFile.SaveAs();

ISA*00* *00* *01*030353283 *01*TERMOMEXI
*050118*1546*U*00304*000014407*1*T*~
GS*CA*G865SQTS*TERMOMEXISQTS*050118*1546*000014407 *X*003040
ST*865*000014407
BCA*00**1***050118
DTM*102*****DT*200501181546
N1*78**1*TERMOMEXI
N1*SJ**1*030353283
POC*-1*OC******CR*A004F1*MN*T
DTM*007*****RD8*20040930-20040930
SLN*1**I*20000.000000*BZ
SI*AP*TT*01*PG*Default*UK*N/A*R2*1*R3*1*DK*N/A
PO3*ZZ*****19830.000000*BZ
N1*M2**29*301068
N1*MQ**29*336408
N1*DW**1*N/A
N1*US**1*N/A
SLN*2**I*15000.000000*BZ
SI*AP*TT*01*PG*Default*UK*N/A*R2*1*R3*1*DK*N/A
PO3*ZZ*****14872.000000*BZ
N1*M2**29*EHR MC
N1*MQ**29*336408
N1*DW**1*N/A
N1*US**1*N/A
POC*-1*OC******CR*A004F1*MN*U
DTM*007*****RD8*20040930-20040930
SLN*1**I*34702.000000*BZ
SI*AP*TT*01*PG*Default*UK*N/A*R3*1*DK*TEXTEST*RR*N/A
N1*MQ**29*336408
N1*DW**1*TERMOMEXI
N1*US**1*N/A
SLN*2**I*15000.000000*BZ
SI*AP*TT*01*PG*Default*UK*A009MC*R2*1*DK*N/A*RR*N/A
N1*M2**29*EHR MC
N1*DW**1*N/A
N1*US**1*067271981
SLN*3**I*20000.000000*BZ
SI*AP*TT*01*PG*Default*UK*97HH*R2*1*DK*N/A*RR*N/A
N1*M2**29*301068
N1*DW**1*N/A
N1*US**1*067271981
CTT*2
SE*000000040*000014407
GE*1*000014407
IEA*1*000014407
--------------CaminusWebExchange32MultiPartPOSTBoundary110609198 5
Content-disposition: form-data; name="transaction-set"

G865SQTS


Notice that the form element "transaction-set" is concatenated to the file.
This only occurs with the user's post, but not with my .aspx test post page.
Any ideas would help.

Dan Corkum
 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      01-20-2005
Dan Corkum wrote:
> Good morning. I am working on an issue that is just baffling me. I
> have developed an .aspx page


There was no way for you to know it, but this is a classic asp newsgroup.
While you may be lucky enough to find a dotnet-savvy person here who can
answer your question, you can eliminate the luck factor by posting your
question to a newsgroup where the dotnet-savvy people hang out. I suggest
microsoft.public.dotnet.framework.aspnet.

HTH,
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HTTP SOAP/HTTP GET/HTTP POST milan_9211 Software 0 01-10-2011 02:10 PM
Deleting incorrect prefill form entries kaplan3jiim@comcast.net Firefox 1 01-07-2007 03:43 AM
http form parsing problem... =?Utf-8?B?RGFuIENvcmt1bQ==?= ASP .Net 0 01-20-2005 07:53 PM
Incorrect parsing of special characters Dario Di Bella Java 3 06-18-2004 01:57 PM
Incorrect parsing of special characters Dario Di Bella XML 6 06-18-2004 01:57 PM



Advertisments