saveFileOnRequest

void scrapeableFile.saveFileOnRequest ( String filePath ) (enterprise edition only)

Description

Save the file returned from a scrapeable file request.

Parameters

  • filePath Location where the file should be saved as a string.

Return Values

Returns void.

Change Log

Version Description
4.5 Available for enterprise edition.

This method must be called from a scrapeable file before the file is scraped. Do not call this method from a script which is invoked by other means such as after an extractor pattern match or from within another script.

It is preferable to use downloadFile; however, at times you may have to send POST parameters in order to access a file. If that is the case, you would use this method.

This method cannot save local file requests to another location.

Examples

Save requested file

 // In script called "Before file is scraped"

 // When the current file is requested it will be saved to the
 // local file system as "sample.pdf".

 scrapeableFile.saveFileOnRequest( "C:/downloaded_files/sample.pdf" );