I am making an app which behaves like cloud storage. I need to upload a file with Alamofire. When I am uploading the related file, I need to append a string which holds path like: "folderName/fileName" (which shows the path on my cloud storage app) to my file data in bytes. I can achieve this by using below code in Java:
@Override
protected Map<String, DataPart> getByteData() {
Map<String, DataPart> params = new HashMap<>();
params.put("parameterName", new DataPart("folderName/fileName", fileInBytes));
return params;
}
But I don't know how to do this in Swift. I need to create a new Data with a string and a data, before uploading it with Alamofire. How can I achieve that? Any response will be appreciated.