You can upload image files or URLs by using multipart/form-data as the content type header. For example, "Content-Type: multipart/form-data" \. Elastic Path Commerce Cloud supports the following file types.
File Extension
Description
.gif
Graphics Interchange Format (GIF)
.jpg/jpeg
Joint Photographic Experts Group (JPEG) format
.png
Portable graphics format
.webp
Web picture format
.mp4
Moving Picture Experts Group (MPEG) format
.mov
QuickTime Movie format
.pdf
Portable Document Format
.svg
Scalable Vector Graphics format
.usdz
Universal Scene Description Format
.glb
Global File format
.jp2
Compressed bitmap image saved in Joint Photographic Experts Group (JPEG) format
.jxr
Extended range for Joint Photographic Experts Group (JPEG) format
.aac
Advanced Audio Coding (AAC) format
.vrml
Virtual Reality Modelling Language (VRML) format
.doc(x)
Microsoft Word Open XML format
.ppt(x)
Microsoft PowerPoint Open XML format
.xls(x)
Microsoft Excel Open XML format
By default, the maximum file size is 8 MB. If you need to support larger file sizes, contact your Elastic Path representative. Alternatively, store files somewhere else and reference them.
As filters are passed as URL query string parameters, we must ensure all filters are URL safe and are strict about the characters that can be used in a filter.
Characters
Can be used in filter?
A-Z (upper)
No (must be lower case).
0-9
Yes
_
Yes
" " (space)
No
Example string for filtering:
const{MoltinClient}=require('@moltin/request')const client =newMoltinClient({client_id:'X',client_secret:'X'})//Clean up the file nameconst filterName = fileName.replace(/[^A-Z0-9]/gi,"_").toLowerCase() client.get(`files/?filter=eq(file_name,${filterName}`);.then(product=>{// Do something...}).catch(console.error)