Skip to main content

File Upload

Upload files you wish in your app by setting up file upload in a few easy steps in DhiWise.


The upload file API is required before your start API binding

Select the file and data type

Bind API

Integrate the file upload API. However, the API should already be added.

Step 1:

Only the upload file API will be available in the list

HeaderContent-type multipart/form-data
FormDataSelected file or constant

Step 2:

Handle API response

KeyGive the key a name
Select type View or save to preference

View: Select the view to which you want to show this API key's data. You will get the code with API response variables assigned to this view's value.

Save to preference: The data will be saved in the API response

Step 3:

Select response for on-success or failure. The responses can be from Navigation, Show Alert, or API Integration.

Example banner

Generated code snippet

@StateObject var exampleViewModel = ExampleViewModel()

isPresented: $exampleViewModel.isActionSheetShow,
content: {
title: Text("Choose"),
buttons: [
action: {
if UIImagePickerController.isSourceTypeAvailable(.camera) {
exampleViewModel.pickerSource = .camera
exampleViewModel.isImagePickerShow = true
} else {
exampleViewModel.showAlert("Error", "Camera is not available!")
Text("Photo Library"),
action: {
exampleViewModel.pickerSource = .photoLibrary
exampleViewModel.isImagePickerShow = true
isPresented: $exampleViewModel.isImagePickerShow,
content: {
MediaPicker(sourceType: exampleViewModel.pickerSource, mediaTypes: ["public.image"]) {
image, url in
if let image = image {
exampleViewModel.selectedImage = image
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {

Got a question? Ask here.