Import Document from URL

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
RLJB
Posts: 914
Joined: Tue Jan 05, 2010 10:16 am
Location: Sydney, Australia

Import Document from URL

Post by RLJB »

Has anyone figured out a way to do this yet? And would like to share the knowledge?

This doesn't work:

TestDoc.Doc=URL_CONTENTS( 'http://www.pdf995.com/samples/pdf.pdf')

nor

IMPORT DOCUMENT TestDoc.Doc FROM 'http://www.pdf995.com/samples/pdf.pdf'
Rod. Aware 8.6 (latest build), Developer Edition, on OS Linux (Ubuntu) using GUI hosted on AWS EC2, MYSQL on AWS RDS
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Import Document from URL

Post by Jaymer »

Use curl
Download the file
Then import

Should be easy
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
RLJB
Posts: 914
Joined: Tue Jan 05, 2010 10:16 am
Location: Sydney, Australia

Re: Import Document from URL

Post by RLJB »

so you have to...

1. prepare a bash script with a CURL statement in it (ie export a file using Aware rules)
2. use EXECUTE PROGRAM to execute the bash script
3. not get any return/confirm back to AwareIM because EXECUTE PROGRAM doesn't return anything
4. have a rule to IMPORT DOCUMENT which may not work based on 3. above

"Should be easy" ... seems pretty convoluted to me? :D

I reckon a built in AwareIM function would be a nice addition (hint hint Aware support) ... and also another to URL_ENCODE would be super useful too.
Rod. Aware 8.6 (latest build), Developer Edition, on OS Linux (Ubuntu) using GUI hosted on AWS EC2, MYSQL on AWS RDS
ACDC
Posts: 1138
Joined: Sat Jun 30, 2007 5:03 pm
Location: California, USA

Re: Import Document from URL

Post by ACDC »

I use this extensively on local files, haven't tried it on a remote url though. I think it's looking to return text contents only, maybe the pdf content is the problem.

example:
DeviceOutput.OutputString=URL_CONTENTS('file:///C:/DeviceOutput/<<DeviceOutput.ID>>.txt')
intra
Posts: 279
Joined: Thu Oct 11, 2012 1:30 pm
Location: Australia

Re: Import Document from URL

Post by intra »

Ding ding!

Readme2460.txt 2018-06-05 13:44 36

Improvements:
1. DOWNLOAD DOCUMENT action
Avid Linux user....
RLJB
Posts: 914
Joined: Tue Jan 05, 2010 10:16 am
Location: Sydney, Australia

Re: Import Document from URL

Post by RLJB »

Oh that's exciting... what does it do? is it from a URL?
Rod. Aware 8.6 (latest build), Developer Edition, on OS Linux (Ubuntu) using GUI hosted on AWS EC2, MYSQL on AWS RDS
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: Import Document from URL

Post by hpl123 »

intra wrote:Ding ding!

Readme2460.txt 2018-06-05 13:44 36

Improvements:
1. DOWNLOAD DOCUMENT action
Did anyone figure out what this action does?
Henrik (V8 Developer Ed. - Windows)
RLJB
Posts: 914
Joined: Tue Jan 05, 2010 10:16 am
Location: Sydney, Australia

Re: Import Document from URL

Post by RLJB »

Very sadly this doesn't import a document from a URL, it does this:

"Download the specified document to the Operators machine"
Rod. Aware 8.6 (latest build), Developer Edition, on OS Linux (Ubuntu) using GUI hosted on AWS EC2, MYSQL on AWS RDS
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: Import Document from URL

Post by hpl123 »

RLJB wrote:Very sadly this doesn't import a document from a URL, it does this:

"Download the specified document to the Operators machine"
Going from download to operators machine to server can't be difficult to solve? (e.g via parameter so either to operator or server machine). Hoping support can further develop this function.
Henrik (V8 Developer Ed. - Windows)
RLJB
Posts: 914
Joined: Tue Jan 05, 2010 10:16 am
Location: Sydney, Australia

Re: Import Document from URL

Post by RLJB »

3 years later and still need a solution...

Anyone know how to download/import a file from a URL using aware rules?

Something like:

IMPORT DOCUMENT TestDoc.Doc FROM 'http://www.pdf995.com/samples/pdf.pdf'
Rod. Aware 8.6 (latest build), Developer Edition, on OS Linux (Ubuntu) using GUI hosted on AWS EC2, MYSQL on AWS RDS
BobK
Posts: 544
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Re: Import Document from URL

Post by BobK »

Would you be interested in a java plug-in that DOWNLOADS and IMPORTS a file from an URL?
Bob
RLJB
Posts: 914
Joined: Tue Jan 05, 2010 10:16 am
Location: Sydney, Australia

Re: Import Document from URL

Post by RLJB »

Hey Bob... at this stage, not yet, I'm busy torturing myself with a new method and I'm eagerly awaiting the storing of Docs in S3 in the next release as it might work better for us anyway.
Rod. Aware 8.6 (latest build), Developer Edition, on OS Linux (Ubuntu) using GUI hosted on AWS EC2, MYSQL on AWS RDS
edvwruhs
Posts: 20
Joined: Wed Jan 18, 2023 11:18 pm

Re: Import Document from URL

Post by edvwruhs »

BobK wrote: Thu Feb 03, 2022 2:50 am Would you be interested in a java plug-in that DOWNLOADS and IMPORTS a file from an URL?
Hey Bob, I would need something similar like this, I would also pay thats not a problem

Best Regards
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: Import Document from URL

Post by hpl123 »

This can´t be that difficult to solve so hoping support can include it in an upcoming version as it would be a very useful feature.
Henrik (V8 Developer Ed. - Windows)
customaware
Posts: 2391
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Import Document from URL

Post by customaware »

I haven't tried this but, just wondering if could it be done in javascript?

For example.....

Code: Select all

const downloadLink = document.createElement('a');
downloadLink.href = 'http://www.mydomain.com/samples/mypdf.pdf';
downloadLink.download = 'mypdf.pdf';
downloadLink.textContent = 'Download PDF';
document.body.appendChild(downloadLink);
Replacing url and file names with tags?
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
Post Reply