Skip to content

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.

Copy link

@akulmehta akulmehta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked out the branch and everything seems to be working. This PR really helps fix an issue when using multipart form data, the browser testing fails because the multipart data in the request is empty due to how the data is being parsed.

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