Skip to content
New issue

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

Support POST requests for UploadFile method #54

Open
CrazyHackGUT opened this issue Jun 26, 2021 · 2 comments
Open

Support POST requests for UploadFile method #54

CrazyHackGUT opened this issue Jun 26, 2021 · 2 comments

Comments

@CrazyHackGUT
Copy link
Contributor

Some web hosting providers are using nginx as primary web server. By default it rejects PUT requests. We can solve this problem by editing the configuration, but usually web hosting providers do not allow doing such things.

@ErikMinekus
Copy link
Owner

The UploadFile function signature is pretty stuck on only using one HTTP method, and PUT seems to be the most appropriate for sending binary data. I also can't handle every webserver's quirks.

Wouldn't a web hosting provider allow at least some custom Nginx configuration, so you can create pretty URLs for example? Supposedly a try_files directive is enough to support PUT and DELETE on Nginx.

@CrazyHackGUT
Copy link
Contributor Author

Currently, we're just require end-user use full URL in configuration file (include index.php). So, for us, this is not a big issue now.
But I don't see anything wrong with implementing an extra parameter for the UploadFile method, which allows POST method to be used instead of PUT.

Maybe just adding CURLOPT_POST force cURL upload file with POST method instead of PUT, i don't tested.

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

No branches or pull requests

2 participants