Skip to content

Support for multipart and files#177

Open
gtg-bantonio wants to merge 5 commits intopestphp:4.xfrom
gtg-bantonio:4.x
Open

Support for multipart and files#177
gtg-bantonio wants to merge 5 commits intopestphp:4.xfrom
gtg-bantonio:4.x

Conversation

@gtg-bantonio
Copy link

@gtg-bantonio gtg-bantonio commented Oct 7, 2025

  • Add support for a form with enctyp="multipart/form-data"
  • Add support for uploaded files (I could not upload the Pest logo for the fixtures. IDK why).
  • Add tests for the URL encode and Multipart form.

@duncanmcclean
Copy link

Just encountered the multipart form issue myself and can confirm this fixes it.

In case its useful for the maintainers, I've just pushed up a repo demonstrating the issue: https://github.com/duncanmcclean/pestphp-formdata-bug

(I haven't tested the file uploads side though!)

@akulmehta
Copy link

I have faced the same issue and this PR fixes it. Hopefully it can be merged.

# Conflicts:
#	src/Drivers/LaravelHttpServer.php
#	tests/Unit/Drivers/Laravel/LaravelHttpServerTest.php
- Removed the multibyte management for the strings, because with empty PDFs and DOCX does not find the boundary string correctly.
- Remove the temp name if the file has an error.
- Standardized the name with the PHP conventions.
- Converted the non-selected files into nulls.
@akulmehta
Copy link

@gtg-bantonio any idea why this PR was closed? It seemed to solve a real issue.

@gtg-bantonio gtg-bantonio reopened this Feb 6, 2026
@gtg-bantonio
Copy link
Author

@akulmehta Sorry, my bad, I was updating the branch to keep it up with the last changes

@akulmehta
Copy link

@gtg-bantonio no apologies needed. I really want this to be merged - thank you for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants