473,657 Members | 2,571 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

POSTing woes...

Please tell me if this makes sense.

I have written an ASPX page to handle and process POSTed XML data to it. I
am expected the data to be in the Request.Form object. This works perfectly
fine when data is posted from an HTML page and even from a HTTPWebrequest. .
Now.. I was getting strange or no data when receiving posted data from PHP
or from FLASH. If I do something along the lines of the listing below.. it
works and I get that data. So.. This seems like a bandaid to me. Why is the
data not in the Request.From object? What am I missing?

If Request.Content Length > 0 Then ' not posting from a form, but there's
something in the request object

Try

Dim strmRequest As System.IO.Strea m

Dim iStrmLen As Integer

Dim iBytesRead As Integer

Dim i As Integer

Dim strRequest As String

strmRequest = Request.InputSt ream

iStrmLen = CInt(strmReques t.Length)

Dim arrRequest(iStr mLen) As Byte

iBytesRead = strmRequest.Rea d(arrRequest, 0, iStrmLen)

For i = 0 To iStrmLen - 1

strRequest = strRequest & Chr(arrRequest( i))

Next i

Dim xDoc As New System.Xml.XmlD ocument

Dim xReader As System.IO.TextR eader

xDoc.LoadXml(st rRequest)

stacey
Nov 18 '05 #1
4 1234
the form object only contains data if the posted content type is a valid
form mime type and the data is in form format. php and flash are posting
just the xml, you other two apps are form encoding it. if you check the
content-type for php and flash, you will probably see
content-type="text/xml".

-- bruce (sqlwork.com)
"Stacey Levine" <st*****@SMAPFI LTERmusicforaso ng.com> wrote in message
news:u5******** ******@TK2MSFTN GP14.phx.gbl...
Please tell me if this makes sense.

I have written an ASPX page to handle and process POSTed XML data to it. I
am expected the data to be in the Request.Form object. This works perfectly fine when data is posted from an HTML page and even from a HTTPWebrequest. . Now.. I was getting strange or no data when receiving posted data from PHP
or from FLASH. If I do something along the lines of the listing below.. it
works and I get that data. So.. This seems like a bandaid to me. Why is the data not in the Request.From object? What am I missing?

If Request.Content Length > 0 Then ' not posting from a form, but there's
something in the request object

Try

Dim strmRequest As System.IO.Strea m

Dim iStrmLen As Integer

Dim iBytesRead As Integer

Dim i As Integer

Dim strRequest As String

strmRequest = Request.InputSt ream

iStrmLen = CInt(strmReques t.Length)

Dim arrRequest(iStr mLen) As Byte

iBytesRead = strmRequest.Rea d(arrRequest, 0, iStrmLen)

For i = 0 To iStrmLen - 1

strRequest = strRequest & Chr(arrRequest( i))

Next i

Dim xDoc As New System.Xml.XmlD ocument

Dim xReader As System.IO.TextR eader

xDoc.LoadXml(st rRequest)

stacey

Nov 18 '05 #2
Hi Stacey,

As for the problem you mentioned, I think Bruce's suggestion is reasonable
and generally we always use the "x-www-form-urlencoded" or
"multipart/form-data " two FORM content type. The x-www-form-urlencodes is
used to post simple ASCII datas and multipart/form-data can help posting
large binary/text datas or non-ascii datas. Here is the reference in W3C:

#17.13.4 Form content types
http://www.w3.org/TR/REC-html40/inte...html#h-17.13.4

Hope also helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #3
Thanks everyone for your replies.

Stacey
"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:9a******** ******@cpmsftng xa06.phx.gbl...
Hi Stacey,

As for the problem you mentioned, I think Bruce's suggestion is reasonable
and generally we always use the "x-www-form-urlencoded" or
"multipart/form-data " two FORM content type. The x-www-form-urlencodes is
used to post simple ASCII datas and multipart/form-data can help posting
large binary/text datas or non-ascii datas. Here is the reference in W3C:

#17.13.4 Form content types
http://www.w3.org/TR/REC-html40/inte...html#h-17.13.4

Hope also helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #4
You're welcome Stacey. Thanks again for your posting!
Have a good day.

Regards,

Steven Cheng
Microsoft Online Support

Nov 18 '05 #5

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

Similar topics

7
1712
by: Mark | last post by:
O, woe is me, to have seen what I have seen, see what I see! (That's Shakespeare for those who were wondering what I'm on about) I am "having fun" with cookies. And I wonder if I have missed something obvious.
0
1519
by: Cedric | last post by:
This is a 3 weeks old problem, but having found a solution (and having looked for one here, finding only this message), I'm replying now. From: Jive (someone@microsoft.com) Subject: Upgrade woes: Numeric, gnuplot, and Python 2.4 Date: 2004-12-11 18:45:10 PST > Here's my sitch: > > I use gnuplot.py at work, platform Win32. > I want to upgrade to Python 2.4.
3
3451
by: Angel Cat | last post by:
Trying to get my jobs to send mail when job fails. Should be easy but it's giving me headache Had a whole slew of issues. Outlook is installed with a n outlook mail profile set up that can send mail in outlook. I can create a SendMail DTS and execute it to send mail Email works in these scenarios 1. I create a DTS package in SQL Server with just SendMail with the same Profile "ABC" and click Execute and it sends
12
3869
by: * ProteanThread * | last post by:
but depends upon the clique: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=954drf%24oca%241%40agate.berkeley.edu&rnum=2&prev=/groups%3Fq%3D%2522cross%2Bposting%2Bversus%2Bmulti%2Bposting%2522%26ie%3DUTF-8%26oe%3DUTF-8%26hl%3Den ...
2
1827
by: Andrew Thompson | last post by:
- NN 4.78 rendering woes, links at far left - I am trying to rework an old site, make it valid html and css, improving the x-browser and 'older browser' compatibility. My efforts so far, have been abysmal. See, for example, this screen shot of the very simple home page, it is not even 10% finished, but I have already run into problems. http://www.physci.org/test/xbrowser/nn478home01.png
0
2091
by: Arun Bhalla | last post by:
I'm having some inconsistency problems with my deployment project ("Setup") and its custom actions ("Installer"). I'm using Visual Studio .NET 2003 (.NET 1.1, no service pack) on Windows XPSP1. My main project is a band object (Explorer Bar) in an assembly (.DLL) that needs to be registered on installation and unregisted on uninstallation. In addition, during installation, Setup creates registry subkeys, sets registry values, installs...
1
1890
by: hdogg | last post by:
Scope Woes - IF statement nested in WHILE statement -PHP I have an array $actuals_sum. <?php while(conditions) { if($i == '24) {
4
2870
by: =?Utf-8?B?VkIgSm9ubmll?= | last post by:
I am at my witless end here, please help! I have an ASP.Net aspx web page, hosted on Windows Server 2003, that receives a query string with the path to an autocad drawing file selected from a web page hosted on a unix driven file server. The user wants to have this file converted to a pdf. My page takes the query string and turns it into a windows unc path, then I copy the file down to the web server and place it into a directory. This...
1
1387
by: Mike Howarth | last post by:
I've been having a few problems with connecting to SQL Server, initially I was using dblib however found some problems with returning text fields whereby all text fields were ignored and it bawked at multiline sql statements. Having found these major stumbling blocks I've started using pymssql which seems less flaky. One problem I've stumbled across is that I seem to reach my max connections on the database fairly easily (given how my...
0
8392
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8305
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8730
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1950
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1607
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.