Closed MichaelEFlip closed 3 years ago
Have you considered using a "Text Input" variable for this? You could create such a variable and include it in the URL. It would mean that the app prompts you to enter a file name every time you invoke the shortcut, which will then become part of the URL.
I think add feature to get name of file picked will be so useful 😊
As of version 2.0.0 (which is being released now), you have access to the file name via Scripting. So what you could do is create a variable (e.g. call it "my_file_name") to hold the file name, use it in the URL for your shortcut, and then in your shortcut's Scripting section set that variable's value to the file name before the shortcut executes, using a piece of code like the following:
setVariable("my_file_name", selectedFiles[0].name);
For more information about Scripting and accessing file information, see https://http-shortcuts.rmy.ch/scripting#files For more information about Variables see https://http-shortcuts.rmy.ch/variables
setVariable("my_file_name", selectedFiles[0].name);
Sorry for re-opening a closed report, but I think this is related.
I'm trying to use this feature to send files using "Share" or "Send To" in apps on my phone, but for some reason the name of the file is never the name of the original file. It is rather something like "shared_
The Android on the phone (Motorola One Zoom) is a Motorola branded Android 10.
The Android on the phone (Motorola One Zoom) is a Motorola branded Android 10.
Does work as expected in Android 7, though.
To upload files to a nextcloud instance you have to use a url in this from: https://nextcloud.mysite.com/public.php/webdav/**test_file.jpg**
In http-shortcuts only a fixed string can be used. It would be good to have the possibility to use a dynamic variable like {filename} if a file is picked from the file picker.
https://nextcloud.mysite.com/public.php/webdav/{filename} -> https://nextcloud.mysite.com/public.php/webdav/my-picked-file.jpg
Thank you for this powerful tool.