Uploading Files
Upload your files to Luw.ai (by Luvi Technologies) servers.
File uploads use a two-step process:
Call
/upload
endpoint to get a signed URLUpload file directly to the signed URL
Luw.ai uses a two-step upload process that enables direct-to-CDN uploads for maximum performance. Instead of routing files through our servers, clients get a signed URL and upload directly to our CDN buckets, significantly improving upload speeds and reducing server load.
Step 1: Get Signed Url and Final Url for Upload
Parameters
filename
file
Required
File name of the file to allocate signed_url
and final_url
.
pid
integer
Optional
Persona ID to associate with the upload
Curl Example
Response Example
The final_url
value is the url of the file you've uploaded. After your upload, the url is ready instantly.
Step 2: Use Signed Url to Upload
After you run upload endpoint, you will get signed_url
parameter to upload file directly from client to our servers. You can directly make PUT request with signed_url
to upload your file. And when your upload finish, you can use the final_url
comes from /upload endpoint.
After successful uploads, you can check response code: 200
Full working HTML - Vanilla JavaScript example (try live demo here):
Supported File Types
jpg
svg
mp4
tif/tiff
png
jpeg
webp
gif
glb
gltf
fbx
Temporary Uploads vs Permanent Uploads
Please use x12tmp-
prefix for file names for temporary uploads, for example: x12tmp-filename.jpg
. With this prefix, we will keep your files 12 hours on our servers and after it's delete automatically.
If you don't add prefix, we will save it till your persona deleted. If you don't add Persona ID with pid
parameter to your upload, we automatically add file to your first persona.
So, for long-time storage operations, please provide pid
value, without any prefixes.
Last updated