#23765 [Ana->Asn]: No raw post data from multipart forms

From: Date: Fri, 23 May 2003 17:48:21 +0000
Subject: #23765 [Ana->Asn]: No raw post data from multipart forms
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969353816@lists.php.net to get a copy of this message
ID: 23765 Updated by: sniper@php.net Reported By: bugs dot php dot com at brome dot com -Status: Analyzed +Status: Assigned Bug Type: Documentation problem Operating System: Slackware Linux PHP Version: 4.3.1 -Assigned To: +Assigned To: sniper New Comment: Assigning to myself, hopefully I can loan one of those phones from a friend. Previous Comments: ------------------------------------------------------------------------ [2003-05-23 12:47:27] sniper@php.net Do you have any URLs to that document? ------------------------------------------------------------------------ [2003-05-23 11:31:34] bugs dot php dot com at brome dot com Well, I need to support file uploads from this device - bug or no... This is the Nokia 3650 smartphone with camera - the one they're selling and advertising on TV worldwide. It would be great if PHP supported the feature that lets you upload photos directly to web albums (that's what I'm trying to create). So far, you're saying this is impossible. Any help would be greatly appreciated! Below is an example from Nokia's API document that shows what the HTTP POST coming form the phone is supposed to look like. Can you or someone tell me if PHP should or should not be able to recognize and handle this as an HTTP POST file upload? POST http://www.club.nokia.com/login/uploadImage?ekey=12345 HTTP/1.1 User-Agent: Photo Uploader (7650/1.0.0) Content-Type: multipart/form-data; boundary=AaB03x Content-Length: xxxx --AaB03x Content-Disposition: form-data; name="DirId" Content-Type: text/plain; charset=utf-8 12345 --AaB03x Content-Disposition: form-data; name="Filename" Content-Type: text/plain; charset=utf-8 cap10001.jpg --AaB03x Content-Disposition: form-data; name="MimeType" Content-Type: text/plain; charset=utf-8 image/jpeg --AaB03x Content-Disposition: form-data; name="ImageData"; filename="cap10001.jpg" Content-Type: image/jpeg Content-Transfer-Encoding: binary <contents of file> --AaB03x-- ------------------------------------------------------------------------ [2003-05-23 10:19:00] sniper@php.net Or it's a bug in Nokia's software, wouldn't be the first. (with the give info, I'm assuming that) If it was sending correct data when uploading files, it would work fine with PHP and $_FILES. Apparently it isn't. Keep this as "Documentation problem" for the reason mentioned earlier. ------------------------------------------------------------------------ [2003-05-23 10:10:40] bugs dot php dot com at brome dot com Okay, then how can I handle this upload situation? A 50K file is being uploaded, and appearing only as a four-byte string in the $_POST array. PHP is mangling and/or throwing away the file data, and there's no way at all to get at the raw data?? I can't change anything on the client side, because it's hard-coded into a Nokia mobile phone. Perhaps the bug is in PHP's handling of multipart form data. It would be ideal if this files data appeared in the $_FILES array like it's supposed to. Unfortunately, since you're saying there's no way get at the raw data, I can't show you what it's NOT parsing correctly... Any thoughts? ------------------------------------------------------------------------ [2003-05-22 20:06:17] sniper@php.net This is not a bug, neither $HTTP_RAW_POST_DATA or php://input contain the POST uploads as those are handled internally by PHP itself before your script is run. Some note would be nice somewhere in the manual about this.. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/23765 -- Edit this bug report at http://bugs.php.net/?id=23765&edit=1

« previous php.doc (#969353816) next »