Welcome Guest, Not a member yet? Register   Sign In
CURLRequest multipart File - nothing send
#5

(02-01-2020, 10:44 AM)jreklund Wrote: I did add an key for my URL and I where able to see everything I posted. form_params works flawlessly, but as the post where about sending a file and multipart, my answer reflects my findings with multipart.

And the only time I could get webhook.site to register content with multipart where when I submitted this array. If I only posted 'text' without any file, the content-length resulted to 0. And thus YMCA never where displayed (submitted?). And it only worked with PHP 7.4.
PHP Code:
$post_data = [
    'text' => 'YMCA',
    'file' => new \CURLFile(FCPATH.'robots.txt''text/plain''robots.txt')
]; 

okay, so it seems to be a Problem with the PHP Version? I only have 7.3.10 on my server sadly. Any Idea how to fix it or an alternative for a post multipart request?

PS: tested the above on my server with php 7.3 and you are right, just doesen't work Sad
Reply


Messages In This Thread
RE: CURLRequest multipart File - nothing send - by Tysonpower - 02-01-2020, 11:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB