Search.../

getMediaUploadUrl( )

Developer Preview

Retrieves a URL, generated by Media Manager, to use when creating a submission with a field for uploading files.

Syntax

function getMediaUploadUrl(formId: string, filename: string, mimeType: string): Promise<GetMediaUploadURLResponse>

getMediaUploadUrl Parameters

NAME
TYPE
DESCRIPTION
formId
string

Form ID.

filename
string

Name of file to upload.

mimeType
string

Mime type of file to upload.

For example, 'image/png'

Returns

Return Type:

Promise<
GetMediaUploadURLResponse
>
NAME
TYPE
DESCRIPTION
uploadUrl
string

Url to upload file.

Was this helpful?

getMediaUploadUrl example

Copy Code
1import { submissions } from 'wix-forms.v2';
2
3 async function getMediaUploadUrl(formId, filename, mimeType) {
4 try {
5 const result = await submissions.getMediaUploadUrl(formId, filename, mimeType);
6
7 return result;
8 } catch (error) {
9 console.error(error);
10 // Handle the error
11 }
12 }
13