[Flask] A minimal example to take upload of a file, call a command on the file, then return the output

Thomas Prebble thomas.prebble at gmail.com
Wed Jul 1 08:15:50 EDT 2020


The example in quickstart will get you what you want for uploads. For the
command execution subprocess is what you need:
https://docs.python.org/3.7/library/subprocess.html

Thomas

On Wed, 1 Jul 2020, 00:03 Peng Yu, <pengyu.ut at gmail.com> wrote:

> I need a minimal flask example, showing how to take upload of a file,
> call a command on the file, then return the output.
>
> The suppose the command is called mycmd.sh. It is called in the following
> way.
>
> mycmd.sh < input.txt > output.txt
>
> The following example is not sufficient for this purpose. Could
> anybody provide a minimal working example for the scenario that I
> mentioned? Thanks.
>
> https://flask.palletsprojects.com/en/1.1.x/quickstart/
>
> Thanks.
>
> --
> Regards,
> Peng
> _______________________________________________
> Flask mailing list
> Flask at python.org
> https://mail.python.org/mailman/listinfo/flask
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20200701/a2ad22ee/attachment.html>


More information about the Flask mailing list