One of 38 things your AI can do in your Instroc account, in Your files
Get upload addresses for files
get_
Makes changes
Ask your AI
- Add my logo
- Use these photos
- Build it from this PDF
What it does
Gives upload addresses for the owner's own files, such as a logo, product photos or a PDF menu, so a client that can make HTTP requests sends the bytes to Instroc itself.
Fits requests like 'use these photos', 'add my logo', 'build it from this PDF'. Takes up to 50 files per call, each with name, type, exact size and an optional sha256, and an optional project_id. Returns per file a file_id, an upload_url on Instroc's domain, an upload_token and expires_at, 15 minutes away; Each file's bytes go in one HTTP PUT to its upload_url, with the header Authorization: Bearer {upload_token} and a Content-Length equal to the declared size. The first PUT to an address is the only one accepted. The address and token together let whoever uses them first fill that file's place, so they are as private as the file; finalize_file_uploads returns the stored file's sha256 so the owner's client can compare. Images (PNG, JPEG, WebP, GIF) are accepted up to 25 MB and 40 megapixels, PDFs up to 32 MB and plain text (.txt, .md, .csv, .json) up to 5 MB; the type is read from the file's bytes, and a file that is itself an SVG, HTML or MathML document (namespaced or not, after any comments and declarations), a program, an archive or a #! script is refused; other text, including Markdown or JSON that quotes HTML or script, is stored and served as plain text, which never runs. Location and camera data are removed from photos. An account starts at most 200 file uploads an hour and 1,000 a day, abandoned ones included. Files are stored in the app's Instroc Cloud storage, in a public folder: anyone with a file's address can open it. An app without Cloud gets no addresses and the answer says how Cloud is turned on; Cloud comes with every plan. Stored files are billed from the first byte at the Cloud storage rate, which storage_price_cents_per_gb_month gives in US cents a GB a month, paid from the plan's Cloud allowance, then from the Cloud balance. storage_used is the app's stored bytes and storage_included the app's storage level, past which an upload needs a Cloud balance (storage_level_source says whether it is the plan's or one the owner set); past_included (none, billed or refused_no_balance) says where the upload stands, and without a balance past that level nothing is stored. Without a project_id the checked files are held for 24 hours, and create_app with their file ids makes the app with Cloud on and stores them in it. After the uploads, finalize_file_uploads checks them, and the file ids then go in the files input of create_app or build_app. A picture attached to the chat is only bytes to a client that holds it as a file. While people and data sharing is on for any app this account administers, and for 24 hours after it is turned off, this tool is held: it changes nothing and uses no credits, and the account holder does this in the Instroc editor.
This is the text your AI reads, word for word.
Direct upload has been tested with Claude Code. In a chat app, use the upload page instead (create_upload_link).
- Changes
- Yes.
Inputs
project_idOptional- The app the files are for, as returned by list_my_apps or create_app. Without it the files are held for a new app made by create_app.
filesRequired- The files to upload, 1 to 50.