473,387 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Incorrect http form parsing problem....

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
Jul 22 '05 #1
1 1500
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.
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: CJ Oxx | last post by:
I have a problem with browser charset recognition when using PHP 4.1.2 (this is the PHP version which our hosting company provides). For charset recognition, I use the following meta-tag: <meta...
5
by: Michelle Kinsey-Clinton | last post by:
Hello, I am writing an ASP app which is giving me some very frustrating errors. They appear intermittently, no real pattern to them, and often go away if you reload, or back up a few pages and...
1
by: Display Name | last post by:
the customer I'm developing a site for uses a canned form-parsing page that allows her to have an email subscription opt-in page add emails to a list she can manage using a link that you point your...
5
by: HJ | last post by:
Hi all, Consider an Access 2002 run-time application on Windows XP. The controls on a form are locked until the user clicks an Edit button. The form is based on a query and all controls are...
0
by: Dan Corkum | last post by:
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...
4
by: Larry Woods | last post by:
I have a Messagebox that looks like: MessageBox.Show("There are pending changes for this patient. Do you want to continue to close?", "Pending Changes", MessageBoxButtons.YesNo,...
6
by: trevor | last post by:
Incorrect values when using float.Parse(string) I have discovered a problem with float.Parse(string) not getting values exactly correct in some circumstances(CSV file source) but in very similar...
0
by: roamnet | last post by:
hi i created database file with .mdf extention ,sql server as a source and use grid view to display data there're no problem in data retrieve and display,but i want to edit it or insert new...
1
imrosie
by: imrosie | last post by:
Hello (from Rosie the newbie), I recently got help with a wonderful event to perform this from 'thescripts'...it recognizes that a name is not in the list an allows for (after parsing first and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.