Extract original filename
Forum rules
iMacros EOL - Attention!
The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely,
The Progress Team
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
iMacros EOL - Attention!
The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely,
The Progress Team
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Extract original filename
Is there a way to extract the original filename (preferably WITH the extention) of, or full path to the file you've just downloaded using ONDOWNLOAD ? I do not want to change the original filename, but I have to use the full path to the file later on in my script code, to be able to send an e-mail with the file attached...
Re: Extract original filename
Anyone? I'm really stuck here...
-
- Posts: 3834
- Joined: Mon May 31, 2010 4:59 pm
Re: Extract original filename
Hi skabaas,
Sorry, this is currently not supported, but it's a great suggestion and I've added it to our feature request list.
You could devise another way to retrieve the filename using script code, but it would be a bit more involved. For example, you could download the file into an empty folder, then use the FileSystemObject to retrieve the name of the only file in that folder.
Sorry, this is currently not supported, but it's a great suggestion and I've added it to our feature request list.
You could devise another way to retrieve the filename using script code, but it would be a bit more involved. For example, you could download the file into an empty folder, then use the FileSystemObject to retrieve the name of the only file in that folder.
Regards,
Tom, iMacros Support
Tom, iMacros Support
Re: Extract original filename
Great, thanks! I solved my problem (for now) using the following VB.net code (I'm using iMacros in combination with VB.net):Tom, iOpus wrote:Hi skabaas,
Sorry, this is currently not supported, but it's a great suggestion and I've added it to our feature request list.
You could devise another way to retrieve the filename using script code, but it would be a bit more involved. For example, you could download the file into an empty folder, then use the FileSystemObject to retrieve the name of the only file in that folder.
Code: Select all
'Use LINQ to retrieve all the files and order them by creation date descending.
Dim allFiles = From path In System.IO.Directory.GetFiles(downloadLocation) _
Let files = New System.IO.FileInfo(path) _
Order By files.CreationTime Descending _
Select files
'The first file in the allFiles variable is the newest File!
Dim newestFile As IO.FileInfo = allFiles.First