Demo-Upload

From iMacros
Jump to: navigation, search

Fill in the tricky file upload fields automatically.

Macro Code

 
VERSION  BUILD=8920312 RECORDER=FX
TAB T=1     
TAB CLOSEALLOTHERS     
URL GOTO=http://demo.imacros.net/Automate/FileUploadDemo
'
TAG POS=1 TYPE=INPUT:FILE FORM=ID:demo ATTR=NAME:uploaded_file CONTENT={{!FOLDER_DATASOURCE}}\Address.csv
'Display some information for the user
TAG POS=1 TYPE=TEXTAREA FORM=ID:demo ATTR=NAME:S1 CONTENT="Done! The filename is in the upload box.\nWe could now click on the \"SUBMIT\" button or continue to fill in the rest of the form." 
'
WAIT SECONDS=1

How to record file uploads:


1. Select the BROWSE button on the website

How to record file uploads

2. The file upload box appears. Below this box is the "File Upload" iMacros dialog. Click on the Browse button on the iMacros dialog (not on the original file upload dialog).

File Upload dialog

3. Select the file to be uploaded and click Open. Now click Close on the iMacros File Upload dialog (the file path is stated in Selected File). iMacros inserts a TAG POS=1 TYPE=INPUT:FILE... command in the macro.

4. Edit the recorded macro. On line TAG POS=1 TYPE=INPUT:FILE... CONTENT=C:\fakepath\..., exchange the content parameter to the correct file path to be uploaded.

5. Now the macro can be replayed.