Forum Moderators: coopster

Message Too Old, No Replies

Passing attachment text from webserver to PHP executor

Passing attachment text from webserver to PHP executor

         

dynumadd

10:06 am on Jan 23, 2004 (gmt 0)

10+ Year Member



Hi all,

I'm building a web server.I'm trying to support php.I'm testing a webmail written in PHP and i've problems in executing the script for attachment.I dont

know how to pass the attachment body to the php executor as i'm getting the attachment with boundaries.

Please help..

Thanks,
Swami.

coopster

2:12 pm on Jan 23, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, dynumadd!

You stated that you are having problems in executing the script for attachment. To invoke the PHP parser, your webserver must be configured to parse PHP scripts by their designated file extension. The default used most often is .php and your server must be configured to recognize this. A quick test of your installation is to create a simple PHP script that will run the phpinfo() [php.net] function, save it with the designated file extension, post the script to your webserver's public directory and open it in your browser.

my_phpinfo.php


<?php
phpinfo();
?>

If you already have this working then I have misunderstood your question and you'll have to provide more information. Once again, Welcome to WebmasterWorld!

dynumadd

6:48 am on Jan 24, 2004 (gmt 0)

10+ Year Member



Let me explain the problem more clearly.

I can able to execute normal scripts without any problems.The problem is when execting scripts with attachemnts.

After getting the POST command like this..

POST /upload.php?sid={4010F46F0F2BD-4010F46F0F2D8-1074852975} HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-powerpoint, application/vnd.ms-excel,

application/msword, */*
Referer: [localhost...]
Accept-Language: en-us
Content-Type: multipart/form-data; boundary=---------------------------7d43868360442
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)
Host: localhost
Content-Length: 400
Connection: Keep-Alive
Cache-Control: no-cache

I'm getting the attachment data (after POST command) like this....

-----------------------------7d43868360442
Content-Disposition: form-data; name="userfile"; filename="C:\dloads\isha.txt"
Content-Type: text/plain

22413544
044-22413544
22381766

091-44-2433-3185

chrompet contacts
22652544

22381766

-----------------------------7d43868360442
Content-Disposition: form-data; name="submit"

Send
-----------------------------7d43868360442--

The problem now is ...

If i'm correct the query string i get from the command is "sid={4010F46F0F2BD-4010F46F0F2D8-1074852975}" and also i've the attachment body.How

to pass these 2 values to the PHP executor?Do i have to parse and edit this attachment data and create a new data with special headers?

Please help..

Thanks,
Swami

coopster

11:44 am on Jan 27, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



/The problem is when executing scripts with attachments.

Are you referring to mail() functions where you have an attachment?