We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The input()->() and request()-> will not catch file contents in request.
I have tried every possible means to handle uploaded files but it's not present in the request body.
I set content type to application/json, it won't. I also set it to url-encoded, even form-data. Neither was it able to handle.
Please is there some other way to get these content?
The text was updated successfully, but these errors were encountered:
Hey,
can you share your request body and headers with us?
~ Marius
Sorry, something went wrong.
Request Header: Authorization: Bearer <token> User-Agent: PostmanRuntime/7.34.0 Accept: / Cache-Control: no-cache Postman-Token: 5c0fe45e-0db4-44dd-b83b-0250c95fe87f Host: localhost Accept-Encoding: gzip, deflate, br Connection: keep-alive Content-Type: multipart/form-data; boundary=--------------------------191050165857157560352247 Cookie: PHPSESSID=hhgbb05m0eklch792b435rjutt Content-Length: 19554622
Request Body: post_text: "Hello world" post_img: <file>
MY CODE:
public function store() { try { $validate = purify(input()->all()); $req = $validate([ "post_text" => 'required', "post_img" => 'optional', ]); //input()->file('post_img') // Always null // $req->post_text == input()->find("post_text) // $req->post_img == input()->file(post-img) // Butt this is always null return Post::getInstance()->store($req->post_text, input()->file("post_img", null)); }catch(\Exception $e) { Logger::system($e->getMessage()); return json_response(["message" => $e->getMessage()]); } }
No branches or pull requests
The input()->() and request()-> will not catch file contents in request.
I have tried every possible means to handle uploaded files but it's not present in the request body.
I set content type to application/json, it won't. I also set it to url-encoded, even form-data. Neither was it able to handle.
Please is there some other way to get these content?
The text was updated successfully, but these errors were encountered: