bugy / script-server

Web UI for your scripts with execution management
Other
1.55k stars 246 forks source link

How do I use file uploading? #563

Closed Beinish closed 2 years ago

Beinish commented 2 years ago

Hello, I'm trying to understand how to properly use the file-upload feature.

I would like to use it as a wrapper for uploading files to my S3 bucket. Not sure if it's possible the way I think of it, but I would like to upload a file to the scriptserver > then to S3 somehow.

The issue I'm having is that I don't know where the file will be located at. I know the name, I know it's under the temp folder, but what from there?

Thanks

hank-pim commented 2 years ago

it will pass the file's path as an argument to your script. here is a simple python3 example that will pull in the first argument/parameter in your script runner and print it.

import sys uploadedfile = sys.argv[1] print(uploadedfile)

Beinish commented 2 years ago

thank you @hank-pim this is perfect. This should enable me to continue with the uploading to S3 part.

Thanks!