Im using Taifuns File Extension to copy files from one directory to another and Im running into a wall.
Ive tested it out and I am able to copy to the folders just fine, but now that im trying to add it to the working app I get "cant copy directory" error messages.
I have a contact app that holds info and 2 photos. Im working on an export and import feature in order to share contacts with others with the app.
I can export just fine. Everything goes to a csv and reimports just fine. But the pictures are giving me a headache.
The Pictures are saved as file paths in the csv. The file path directs it to the /storage/emulated/0/Pictures/_app_inventor_image_picker/ folder.
The app uses an image picker for choosing the photo and saves a copy in the above folder with a new name.
My export uses a share (3 actually) one shares the csv. the other 2 shares the images from the above folder holding on to their new name. The orignal picture is not in service and is not exported.
When the user recieves the emails containing the files they simply save them to the download folder and the app imports them from that folder is this fashion:
The CSV has a name, that name is entered in the import textbox and the csv is imported into the app and populates the boxes. Within that csv is the path to the photos.
I have 2 labels set up to display the path and file name of each photo. The Import looks at those labels and continues to copy the files from downloads to /storage/emulated/0/Pictures/_app_inventor_image_picker/.
Except, I get a Sorry,cant copy a directory.
If I hard code the file and path like the copy block that is not attached in the image above, it copys just fine.
when I try to join text in order to keep the paths the same, but make the file name change based on the info in the csv, I get the error.
I have used the File Exists block and it shows true.
Ive tried using replace block, as shown, to get rid of the file path and only display the file. So I can use that to copy, doesnt work.
Ive tried using split, and Segment Text. That seemed to work, But the file path is always 56 characters. fine. The file name, is 19-20 characters. depending on the file. So It throws and error saying the files too long.
Is there a way to use the segment text block and say :start-56, length - open or count how many spaces in that file name?
Ive also cleared out the test phone and dumped the cache several times in order to see it clean.
Any ideas?