D
Dan Corkum
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;
--------------CaminusWebExchange32MultiPartPOSTBoundary1106091985
Content-disposition: form-data; name="from"
030353283
--------------CaminusWebExchange32MultiPartPOSTBoundary1106091985
Content-disposition: form-data; name="to"
TERMOMEXI
--------------CaminusWebExchange32MultiPartPOSTBoundary1106091985
Content-disposition: form-data; name="input-format"
x12
--------------CaminusWebExchange32MultiPartPOSTBoundary1106091985
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
--------------CaminusWebExchange32MultiPartPOSTBoundary1106091985
Content-disposition: form-data; name="transaction-set"
G865SQTS
--------------CaminusWebExchange32MultiPartPOSTBoundary1106091985
Content-disposition: form-data; name="batch-id"
23
--------------CaminusWebExchange32MultiPartPOSTBoundary1106091985--
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
--------------CaminusWebExchange32MultiPartPOSTBoundary1106091985
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
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;
--------------CaminusWebExchange32MultiPartPOSTBoundary1106091985
Content-disposition: form-data; name="from"
030353283
--------------CaminusWebExchange32MultiPartPOSTBoundary1106091985
Content-disposition: form-data; name="to"
TERMOMEXI
--------------CaminusWebExchange32MultiPartPOSTBoundary1106091985
Content-disposition: form-data; name="input-format"
x12
--------------CaminusWebExchange32MultiPartPOSTBoundary1106091985
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
--------------CaminusWebExchange32MultiPartPOSTBoundary1106091985
Content-disposition: form-data; name="transaction-set"
G865SQTS
--------------CaminusWebExchange32MultiPartPOSTBoundary1106091985
Content-disposition: form-data; name="batch-id"
23
--------------CaminusWebExchange32MultiPartPOSTBoundary1106091985--
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
--------------CaminusWebExchange32MultiPartPOSTBoundary1106091985
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