Skip to content
TheChatArchiveThe Chat Archive
gpt-3.5-turbo-0125· OpenAIAi2 WildChat-4.8M (AI2)

A code snippet to send files through curl in a loop that goes through files that match…

  1. 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"

  2. 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"
    done
    

    Replace your_token with your actual token, /path/to/files with the directory path containing the files, and *.txt with 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.