Trouble downloading images
I LOVE this product and have been making great strides with it so far in my evaluation of the professional edition. I am having difficulties, however, downloading images.
SKU (6-digit number) and IMG_SOURCE (full http://.... URL of image)are tokens extracted from a DATARECORD. After each pattern application of the DATARECORD I am invoking a script which calls
session.downloadFile( session.getVariable( "IMG_SOURCE" ), "D:\Images\" + session.getVariable( "SKU" ) = ".jpg");
The "Images" folder exists and the images I'm downloading are JPG's. I'm trying to save each image with the filename of the SKU.
In my log I am ecountering:
The error message was: The application script threw an exception: java.lang.StringIndexOutOfBoundsException: String index out of range: -2 BSF info: null at line: 0 column: columnNo
I don't know how to interpret this. I've browsed the entire discussion board and your support documents, but nothing so far has provided a solution. I'm getting desperate! Any help is greatly appreciated.
Trouble downloading images
It worked! Thanks a million :D
Trouble downloading images
Hi,
Java is a bit funny about file path separators. Try changing this line:
session.downloadFile( session.getVariable( "IMG_SOURCE" ), "D:\Images\" + session.getVariable( "SKU" ) + ".jpg");
to this:
session.downloadFile( session.getVariable( "IMG_SOURCE" ), "D:/Images/" + session.getVariable( "SKU" ) + ".jpg");
If that doesn't help, feel free to post a reply.
Kind regards,
Todd Wilson
Trouble downloading images
I mistyped in my last post... I have a "+" in the code, not a "=" as I had typed, so it's:
session.downloadFile( session.getVariable( "IMG_SOURCE" ), "D:\Images\" + session.getVariable( "SKU" ) [b]+[/b] ".jpg");
Any ideas are welcome.