Jump to content

Recommended Posts

Hello,

I am having some issues on how to retrieve a chunked CSV file sent to my callback URL.

this is what is being sent to by callback URL

Method:
1 POST
Headers:
1 content-dispositon: form-data; name="file"; filename="dipa1b2c3.csv"
2 transfer-encoding: chunked
3 content-type: application/csv
Body:
1 <bytes of the CSV>

 

if I set the callback url to receive the POST to request catcher I see all the stuff in there but from PHP I dont know how to get the actual contents of the CSV file being sent to me.

 

this is what request catcher sees.

POST /?bulk_dip_task[id]=01GQJAYVE75QE6QE1J1P3F892D&bulk_dip_task[reference_id]=Test-LRN-Lookup&on_done_action[id]=01GQJAYVE7NDP25KRBWVHC1QYQ&on_done_action[type]=send HTTP/1.1
Host: nuvana.requestcatcher.com
Transfer-Encoding: chunked
Content-Type: multipart/form-data; boundary=------------0185E4AF6EF0E2670003B558416EC8F4
User-Agent: mercury-bulk-dip-task-worker/1.0
X-Mercury-Bulk-Dip-Task-Id: 01GQJAYVE75QE6QE1J1P3F892D
X-Mercury-Bulk-Dip-Task-Reference-Id: Test-LRN-Lookup
X-Mercury-On-Done-Action-Id: 01GQJAYVE7NDP25KRBWVHC1QYQ
X-Mercury-On-Done-Action-Type: SEND

265
--------------0185E4AF6EF0E2670003B558416EC8F4
content-disposition: form-data; name="file"; filename="dip-01GQJAYVE75QE6QE1J1P3F892D.csv"
transfer-encoding: chunked
content-type: application/csv

Status,LRN,MessagingEnabled,CDRID,PhoneNumber,ErrorCode,SwitchName,RateCenter,OCN,LATA,CarrierType,CarrierName
COMPLETED,12893170001,false,01GQJAYVQ3XHCRW9B0QET3HWX8,19057225234,OK,SUTTON,SUTTON,082E,888,CLEC,Distributel Communications Limited
COMPLETED,16475800002,true,01GQJAYVQ33KBHQ8JM7C4SD6VY,14169922312,OK,TORONTO,TORONTO,8303,888,PCS,TELUS Mobility

--------------0185E4AF6EF0E2670003B558416EC8F4--

0

 

from my PHP application when I read the $_Get I see this

23:02:03 09:25:47 - received_GET - key: bulk_dip_task - Value: Array
23:02:03 09:25:47 - bulk_dip_task - key: id - Value: 01GRBTPH4W4TCPTQQ0GK2X8R39
23:02:03 09:25:47 - bulk_dip_task - key: reference_id - Value: Test-LRN-Lookup
23:02:03 09:25:47 - received_GET - key: on_done_action - Value: Array
23:02:03 09:25:47 - on_done_action - key: id - Value: 01GRBTPH4WXBJV35HM1AN6STEM
23:02:03 09:25:47 - on_done_action - key: type - Value: send

I need to be able to get the content sent back and I am not sure how to do that, i tried many different things and no luck...can any one help out.

 

to recap, I have a callbak URL that is being used to POST a chucked CSV file to. if I use request catcher as my callback URL it shows me everything but I dont know how to receive everything in PHP.

 

I checked and there is nothing in $_Files. so not sure why PHP is not seeing it where request catcher can. I thought I read about some kind of bug in apache if the content length is not set in the headers....  

 

 

if ( !isset($_FILES['upfile']['error']) || is_array($_FILES['upfile']['error']) ) { throw new RuntimeException('Invalid parameters.'); }

 

I get invalid parameters.

Edited by grjoseph

Where you are getting "upfile" from? I don't see that anywhere in the sample request you showed. The actual name was

content-disposition: form-data; name="file"; filename="dip-01GQJAYVE75QE6QE1J1P3F892D.csv"

"file"

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.