Upload a file
POST /v1/browser/{session_id}/uploads puts a file in the session under the name you give it. Send the bytes as base64, or send a url for Stophy to fetch.
url instead of base64. name is optional then, and defaults to the last part of the address.
size 30. The address must open the file with no sign-in, and Stophy waits 30 seconds for it.
Use the file on a page
Point a file field at the uploaded name. This call opens an upload form, picksnotes.txt, submits, and returns the name the page shows.
result set to notes.txt, so the page took the file. A running session lists its uploads in uploads when you read it.
Read downloads
A file the page downloads is saved in the session.GET /v1/browser/{session_id}/downloads lists them, sorted by name. Add includeUrls=true to get a link for each file.
download name. The signature is cut.
200 with text/plain and the body Hello from Stophy. It stops working after 15 minutes. Read the list again for a new link.
Options
Limits and errors
- A file is at most 20 MB, and a session takes at most 100 MB of uploads. A larger file returns
400 invalidRequestwithA file can be at most 20 MB. - Sending both
base64andurlreturns400 invalidRequestwithSend base64 or url, not both.Sending neither, orbase64with noname, returns400 invalidRequestwithSend the file as base64 with a name, or as a url. - A
urlthat does not answer with a success status returns400 invalidRequest. This real one pointed at a missing file:The file address answered 404. Send an address that opens the file without signing in. - A session that has ended answers
410 notFoundto an upload, and409 invalidRequestto a download list:This browser session is not running, and its files are removed when it closes. - Downloads and uploads are removed when the session closes. Fetch what you need first.
Related
- Browser sessions opens and closes the session.
- Execute clicks the file field and downloads.
- Upload reference and downloads reference list every field.