Re: grabbing data from a POST
Re: grabbing data from a POST
- Subject: Re: grabbing data from a POST
- From: Joshua Paul <email@hidden>
- Date: Sat, 10 May 2008 15:17:22 -0700
We found the issue. It was a misplaced comma, instead of a semi-colon
following "multipart/form-data" in the request.
Thanks everyone.
On May 9, 2008, at 10:55 AM, Chuck Hill wrote:
Use a hex editor to look at the raw requests. Years ago there was a
similar problem with IE where the request was missing a ^M/carriage
return after the content boundary. This sounds like a similar
problem: you are receiving a malformed request.
We fixed it by hacking, er cleverly altering, the Apache WO adaptor
to detect the problem and insert the missing byte.
Chuck
On May 9, 2008, at 10:46 AM, Joshua Paul wrote:
Yeah, it works with a browser and with Flash.
I can get at the content, it's just posted in the 'content' of the
request and not as a form value. I wasn't sure if there was a way
to get at it, but it doesn't seem like it.
Thanks!
On May 9, 2008, at 10:16 AM, Chuck Hill wrote:
But _try_ with a browser. See if you can isolate the problem to
the WO code or the request you are receiving. If it works with
Safari, the problem is not in your code.
On May 9, 2008, at 10:15 AM, Joshua Paul wrote:
iPhone...not using browser.
On May 9, 2008, at 10:07 AM, Chuck Hill wrote:
On May 9, 2008, at 9:55 AM, Joshua Paul wrote:
FWIW, I get the following when grabbing
this.request().contents() in the DirectAction:
values: <class
com.webobjects.appserver._private.WOInputStreamData (stream
com
.webobjects
.appserver._private.WONoCopyPushbackInputStream@7f9a29 of
length 418147), has NOT been accessed>
I can then write the WOInputStreamData out to disk. Within that
file, I see:
Content-Disposition: form-data; name="Filedata";
filename="image.jpg"
Content-Type: application/octet-stream
ˇÿˇ‡JFIF†€
€
C
ˇ¿ˇƒ
If I remove the 'human readable' text, I do get the image. So
my question is, is there a facility within WO to parse this out?
I am not sure what, but you are doing something wrong or have
something setup wrong or are getting a malformed HTTP request
(user-agent = (CFNetwork/221.5);).
You should just get the binary form value. Try a real browser.
Chuck
On May 9, 2008, at 2:14 AM, Stefan Klein wrote:
Hi,
seems to be a problem with FileUpload. I never done this using
a direct action.
I think the following may be a good starting point:
http://www.mail-archive.com/email@hidden/msg04304.html
Stefan
Joshua Paul schrieb:
headers: {remote_host = (::1); user-agent = (CFNetwork/
221.5); document_root = (/Library/WebServer/Documents);
server_name = (localhost); accept = (*/*); remote_addr = (::
1); content-type = ("multipart/form-data,
boundary=0194784892923"); server_admin = (email@hidden);
remote_port = (55798); connection = (close); server_software
= (Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.7l DAV/2);
host = (localhost); accept-encoding = (gzip, deflate); x-
webobjects-request-id = (482352030000001c000000af);
script_uri = (http://localhost/cgi-bin/WebObjects/Ducere.woa/-5555/wa/uploadImage
); accept-language = (en-us); script_url = (/cgi-bin/
WebObjects/Ducere.woa/-5555/wa/uploadImage); x-webobjects-
request-method = (POST); x-webobjects-adaptor-version =
("Apache"); content-length = ("435492"); script_filename = (/
cgi-bin); server_port = (0); }
keys: null
values: null
On May 9, 2008, at 12:26 AM, Stefan Klein wrote:
Hi,
what did you see using:
NSLog.debug.appendln("headers: " + request().headers());
NSLog.debug.appendln("keys: " + request().formValueKeys());
NSLog.debug.appendln("values: " + request().formValues());
Stefan
Joshua Paul schrieb:
That's just it, when I do that I get a NPE.
If I grab this.request().content() and write it to disk, I
can see that the data is there (Content-Disposition, etc.).
Other thoughts?
On May 9, 2008, at 12:16 AM, Stefan Klein wrote:
Hi,
you can use request().formValueForKey("Filedata") in your
DirectAction
Stefan
Joshua Paul schrieb:
I have data coming into my app via a POST in a
DirectAction. I can obtain the data via:
(WOInputStreamData) this.request().content()
But that's where I'm stumped. Once I've grabbed the raw
data, how can I extract the form information/data from it?
Content-Disposition: form-data; name="Filedata";
filename="image.jpg"
Content-Type: application/octet-stream
ˇÿˇ‡JFIF†€
€
C
ˇ¿ˇƒ
TIA.
--
Josh Paul
email@hidden
twitter: joshpaul
linkedin: joshpaul
NOTICE: This e-mail message and all attachments transmitted
with it are intended solely for the use of the addressee and
may contain legally privileged and confidential information. If
the reader of this message is not the intended recipient, or an
employee or agent responsible for delivering this message to
the intended recipient, you are hereby notified that any
dissemination, distribution, copying, or other use of this
message or its attachments is strictly prohibited. If you have
received this message in error, please notify the sender
immediately by replying to this message and please delete it
from your computer.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve
specific problems.
http://www.global-village.net/products/practical_webobjects
--
Josh Paul
email@hidden
twitter: joshpaul
linkedin: joshpaul
NOTICE: This e-mail message and all attachments transmitted with
it are intended solely for the use of the addressee and may
contain legally privileged and confidential information. If the
reader of this message is not the intended recipient, or an
employee or agent responsible for delivering this message to the
intended recipient, you are hereby notified that any
dissemination, distribution, copying, or other use of this
message or its attachments is strictly prohibited. If you have
received this message in error, please notify the sender
immediately by replying to this message and please delete it from
your computer.
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve
specific problems.
http://www.global-village.net/products/practical_webobjects
--
Josh Paul
email@hidden
twitter: joshpaul
linkedin: joshpaul
NOTICE: This e-mail message and all attachments transmitted with it
are intended solely for the use of the addressee and may contain
legally privileged and confidential information. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution,
copying, or other use of this message or its attachments is
strictly prohibited. If you have received this message in error,
please notify the sender immediately by replying to this message
and please delete it from your computer.
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
--
Josh Paul
email@hidden
twitter: joshpaul
linkedin: joshpaul
NOTICE: This e-mail message and all attachments transmitted with it
are intended solely for the use of the addressee and may contain
legally privileged and confidential information. If the reader of this
message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, you
are hereby notified that any dissemination, distribution, copying, or
other use of this message or its attachments is strictly prohibited.
If you have received this message in error, please notify the sender
immediately by replying to this message and please delete it from your
computer.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden