I was trying to show an image in the app based on a dynamic URL. My dynamic URL is built on an Integromat webhook, which returns file with header (Content-Type: image/png and Content-Disposition: inline; filename="file.png), but itself does not look like image URL - no .png extension
Likely due the URL looking strange, the Image module does not recognize it as an Image. I have decided to use the Download file component instead. The “testerVariable” was linked to Image and was displaying the file.
I noticed however:
1 Format of path property
Download returns following path
In e.g. Take Photo component, the path is returned as:
I am not sure if the lack of “file://” is affecting anything down the line.
2. Download component not fetching file name
One of the inputs to Download component is “Name” of the file to be downloaded, which probably should work this way that if it is empty, it receives the name of the file (via filename or header) from the download link.
Currently download returns “path”(local storage), size and mimeType. No name ( I have also tested download on simple links … like /cat.png)
3. Move/rename file/directory is always in overwrite mode
Moving a file, regardless of setting True or False, the target file was always overwritten. There might be a bug there.
4. Cashing of files by Image component.
I was moving the downloaded files to a local folder, where I wanted to have them always overwrite filename.png. This works, I could see the file content change via separate File explorer app. In my app however the Image element showing filename.png was showing the same picture as the first image I have downloaded. If I changed to filename2.png , I could see new image, but only for the first download. Looks like everytime I need to change the file name.
Does the Image component has some internal cashing for local files?
5. Keeping files in default download directory
Finally, I figured out that I can just keep the file in the default download directory and only rename it to UUID.png (using relative patch = True in the “Move/rename file/directory”)
How long are the downloaded files staying in the /com.appgyver.agclient/ folder? Will I end up with a bunch of files in that location after a longer use?
Maybe a better option to download files for a single time use is Cache files as described below?