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 to file upload(plugin) #33

Open
EvandroLG opened this issue May 20, 2015 · 3 comments
Open

support to file upload(plugin) #33

EvandroLG opened this issue May 20, 2015 · 3 comments

Comments

@EvandroLG
Copy link
Owner

No description provided.

@zac23or zac23or changed the title support to file upload support to file upload(plugin) Jun 9, 2015
@zac23or
Copy link
Collaborator

zac23or commented Jun 9, 2015

Api: table_files = request.get_files()

@EvandroLG
Copy link
Owner Author

API:

  • content_type_filter = {"jpg", png"}
  • content_type_discover={ "file_type","file_extension"}
  • destination = "image/"
  • min_ body_size = 1048576
  • max_body_size = 1048576
  • file

@midn1
Copy link

midn1 commented Mar 23, 2023

Here is a patch to the master branch which adds basic multi-part form parsing capability (and so file uploads too). It's not implemented as a plugin and, frankly, I have no idea how that would even be done without extreme breaking changes.

Unlike other parameters, files have more data than just their name and value, so they are stored in the post data as tables. The rest is as it were to maintain backwards-compatibility. Find in request:post().

I do not recommend using this in production. I'm certain malicious input is still capable of crashing it, and there's not even a max file or max content size. At least it exists, which is more than can be said for the file uploading plugin.

Looking for input on implementation, before this is polished and potentially pushed in.

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

3 participants