Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uploading multiple files to PHP server #1

Open
Qberon opened this issue Mar 31, 2020 · 0 comments
Open

Uploading multiple files to PHP server #1

Qberon opened this issue Mar 31, 2020 · 0 comments

Comments

@Qberon
Copy link

Qberon commented Mar 31, 2020

Thank you for a detailed very good explained class and tutorial

For uploading multiple files to server under PHP you need to declare file names as an array like this
name: "uploadedFile[1]" , name: "uploadedFile[2]", name: "uploadedFile[3]"

let textFileURL = Bundle.main.url(forResource: "sampleText", withExtension: "txt")
let textFileInfo = RestManager.FileInfo(withFileURL: textFileURL, filename: "sampleText.txt", name: "uploadedFile[1]", mimetype: "text/plain")

let pdfFileURL = Bundle.main.url(forResource: "samplePDF", withExtension: "pdf")
let pdfFileInfo = RestManager.FileInfo(withFileURL: pdfFileURL, filename: "samplePDF.pdf", name: "uploadedFile[2]", mimetype: "application/pdf")

let imageFileURL = Bundle.main.url(forResource: "sampleImage", withExtension: "jpg")
let imageFileInfo = RestManager.FileInfo(withFileURL: imageFileURL, filename: "sampleImage.jpg", name: "uploadedFile[3]", mimetype: "image/jpg")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant