Upload image data directly from FlaskForm into pdf without uploading it to the server. #599
Replies: 1 comment 2 replies
-
The docstring for the
I suspect your image data comes in as a bytes object. You now have a choice of converting that either to a I'm not sure why simply supplying a bytes object is not supported. That may have historical reasons from a time when byte and text strings weren't as clearly distinguished as they are today. The API of using the same parameter for both file names and actual data also doesn't provide optimal flexibility. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm trying to figure out how I can place image data to pdf document without uploading it to the server.
In other words, I have a form (FlaskForm) in the page where the user fills in some data and one field is FileField. I use that data to place it into PDF document. String fields works fine but image.data doesn't want to work. It will probably work if I first save the image in the server after form submission and then specify the path to that image. But I really don't want to save the image to the server but use its data directly to upload it in the PDF. Here is my code:
Beta Was this translation helpful? Give feedback.
All reactions