gpt-3.5-turbo-0125· OpenAI
WildChat-4.8M (AI2)
A code snippet to send files through curl in a loop that goes through files that match…
- User
A code snippet to send files through curl in a loop that goes through files that match the pattern use curl -X POST 'https://store1.gofile.io/contents/uploadfile' -H "Authorization: Bearer your_token" -F "file=@file.txt"
- Assistant
Here's a code snippet in bash that uses curl to send files matching a certain pattern in a loop:
TOKEN="your_token" DIRECTORY="/path/to/files" PATTERN="*.txt" for file in $DIRECTORY/$PATTERN; do curl -X POST 'https://store1.gofile.io/contents/uploadfile' -H "Authorization: Bearer $TOKEN" -F "file=@$file" doneReplace
your_tokenwith your actual token,/path/to/fileswith the directory path containing the files, and*.txtwith the pattern to match the files. This script will loop through all the files in the directory that match the pattern and send them using curl to the specified endpoint.