How do I solve the problem on the ONDOWNLOAD?

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
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
Post Reply
zcsu520
Posts: 2
Joined: Tue Apr 26, 2011 8:55 am

How do I solve the problem on the ONDOWNLOAD?

Post by zcsu520 » Tue Apr 26, 2011 9:21 am

Please excuse my English is not very good, because it is not my first language.
I use firefox 4.0 and imacros 7.2.0.8 version.

I'm writing a script to download csv file. But I had a problem that I can not specify a file name and directory.
I search the relevant post in the forum and found the problem. I tested if my csv file download link is directly to a csv file, which is able to download to the specified file name. But the problem is I really want to download the file link is not directly to a csv file. I tried a variety of methods, but without success.

Is there any way to download this csv file to the specified file name?
Tom, Tech Support
Posts: 3711
Joined: Mon May 31, 2010 4:59 pm

Re: How do I solve the problem on the ONDOWNLOAD?

Post by Tom, Tech Support » Mon May 02, 2011 7:53 am

Hi zcsu520,

The short answer is that for some types of downloads (e.g. those that are not initiated with a direct link to the file and SAVETARGETAS is not used), Firefox itself handles the download and saves the file in the Firefox downloads folder. This is due to how the Content Type and General download settings are configured in the Firefox Options.

Other uses have worked around this issue by writing their own script to copy/rename the file after the macro runs and it is downloaded.

I have logged this issue for further investigation by the development team.
Regards,

Tom, iMacros Support
zcsu520
Posts: 2
Joined: Tue Apr 26, 2011 8:55 am

Re: How do I solve the problem on the ONDOWNLOAD?

Post by zcsu520 » Mon May 02, 2011 3:31 pm

:) ok, thank you for your answer, I know how to do it.
Tom, Tech Support
Posts: 3711
Joined: Mon May 31, 2010 4:59 pm

Re: How do I solve the problem on the ONDOWNLOAD?

Post by Tom, Tech Support » Tue May 17, 2011 12:43 am

UPDATE: Additional information regarding this topic can be found in Tips for downloading files with ONDOWNLOAD.
Regards,

Tom, iMacros Support
cqp
Posts: 5
Joined: Sat Jul 07, 2012 2:52 am

Re: How do I solve the problem on the ONDOWNLOAD?

Post by cqp » Wed Jul 18, 2012 3:18 am

Tom, iOpus wrote:Hi zcsu520,

The short answer is that for some types of downloads (e.g. those that are not initiated with a direct link to the file and SAVETARGETAS is not used), Firefox itself handles the download and saves the file in the Firefox downloads folder. This is due to how the Content Type and General download settings are configured in the Firefox Options.

Other uses have worked around this issue by writing their own script to copy/rename the file after the macro runs and it is downloaded.

I have logged this issue for further investigation by the development team.
Hi -- this is actually a terrible workaround in many cases, and incredibly insecure. As an example, let's say you have a website that allows users to extract their data from, say, their financial institution, and you use iMacros to do the extraction.

So, User1 logs in to your site, gives you the credentials to their financial institution, and then, using those credentials, you log into the financial institution on the users' behalf and save the file as the default name "my_financial_data.xls".

HOWEVER, it turns out user2 makes the same request on your site, a split second after User1 (or even at the same time), and therefore we are running TWO separate instances of firefox at the same time, both attempting a scrape at the same time. These two instances would BOTH save the file to the same destination name, and the subsequent script would have no idea which file was which, and risks associating the wrong data with the wrong user...
jofin.oxalisys
Posts: 1
Joined: Thu Apr 04, 2013 9:44 pm

Re: How do I solve the problem on the ONDOWNLOAD?

Post by jofin.oxalisys » Thu Apr 04, 2013 9:57 pm

Hi,

I'm using VERSION BUILD=8032216 on Windows 7 and now I'm facing a very weird kind of issue with ONDOWNLOAD COMMAND, I'm pasting the command below

VERSION BUILD=8032216
SET !TIMEOUT_PAGE 2
SET !ERRORIGNORE YES
TAG POS=1 TYPE=TD ATTR=TXT:*rog*
TAG POS=R-1 TYPE=A ATTR=TXT:*Filing<SP>Other*
WAIT SECONDS=2
ONDOWNLOAD FOLDER=* FILE={{RNAME}} WAIT=YES
WAIT SECONDS=45

Now the issue, iMacro is not taking the file name which I'm passing as RNAME from VB. I have done this in the past also but now suddenly it does not take this name and thus does not save the file, it gets stuck with save dialog and I have to manually click the save button on the dialog and the files gets save in the name given by the website.

If I change the RNAME to any other name like FILE=abcdef.pdf, then it will save. I'm pasting the script part also where I'm passing this file name.

FileName = cOurFile + "_" + cNum + "_ROGS.pdf"
griim.iimSet("RNAME", FileName)
imchk = griim.iimPlay("RogsDload")

Can Anybody help me with this problem.
Post Reply