Swift iOS file download/check/upload - code need to be fixed
Budget: £36 – £0 GBP
I am working on a project which is similar to transferring files to a GoPro, with the following steps:
1. Download file from a web server to an iPhone
2. Wait and check for the file to be downloaded onto an iPhone
3. Switch WiFi networks to a local ESP32
4. Transfer the above file to the ESP32
I have the code from various sources, but I am not successful with downloading and uploading the files. The server download seems to work, as I can check if the file exists and I can delete and re-download the file.
The problem is I don't know the location of the file, as I cannot check it on the iPhone and if I complete the file check it always states the file is not present. This is the same for the file upload, it reports the file is not present.
I think the issues is when we download a file we get a url (see below), but I am unsure if this is the folder location or the 213270011 is the file name?
var/mobile/Containers/Data/Application/34AA9E70-7F7C-4070-A8DE-F9BD1050F37B/Documents/213270011
Ideally what I need is the following
1. Check the code is downloading from a server from function "loadFileAsync" I am 100% sure this is working
2. Provide an URL to this folder & file location
3. Re-write/update the function checkfile() to test if the file exists base on the above url. We have to change the function so it has an incoming URL string
4. In the function uploadfiletoTC() this can take the above url/file location, I think all the code is correct in this function it's just missing the correct file URL
I am not sure if this would be possible to move the download file to the iOS download folder? As we can see the file been downloaded via the server call. We are sending the file to an esp32, so it should all be contained in the
uploadfiletoTC() .
Another general question is what is the address of the download folder? As we can download the file directly from the server via the http page and then upload it, but I need to understand the file location of the files in the download folder.
Ideally we do not want to use 3rd add on software, so needs to be contained with Swift.
1. Download file from a web server to an iPhone
2. Wait and check for the file to be downloaded onto an iPhone
3. Switch WiFi networks to a local ESP32
4. Transfer the above file to the ESP32
I have the code from various sources, but I am not successful with downloading and uploading the files. The server download seems to work, as I can check if the file exists and I can delete and re-download the file.
The problem is I don't know the location of the file, as I cannot check it on the iPhone and if I complete the file check it always states the file is not present. This is the same for the file upload, it reports the file is not present.
I think the issues is when we download a file we get a url (see below), but I am unsure if this is the folder location or the 213270011 is the file name?
var/mobile/Containers/Data/Application/34AA9E70-7F7C-4070-A8DE-F9BD1050F37B/Documents/213270011
Ideally what I need is the following
1. Check the code is downloading from a server from function "loadFileAsync" I am 100% sure this is working
2. Provide an URL to this folder & file location
3. Re-write/update the function checkfile() to test if the file exists base on the above url. We have to change the function so it has an incoming URL string
4. In the function uploadfiletoTC() this can take the above url/file location, I think all the code is correct in this function it's just missing the correct file URL
I am not sure if this would be possible to move the download file to the iOS download folder? As we can see the file been downloaded via the server call. We are sending the file to an esp32, so it should all be contained in the
uploadfiletoTC() .
Another general question is what is the address of the download folder? As we can download the file directly from the server via the http page and then upload it, but I need to understand the file location of the files in the download folder.
Ideally we do not want to use 3rd add on software, so needs to be contained with Swift.