Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 9:13 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Load image from internet at runtime
PostPosted: September 6th, 2007, 9:16 pm 
Offline

Joined: November 11th, 2004, 4:05 am
Posts: 636
Location: Christchurch, NZ
If I want to load an image into a pub from a web server at runtime, how do I do it?
I don't want to use a browser object as I want the image displayed directly on a page.
I've been playing with the internetPostData and internetGetData functions but can't seem to get them to import an image then display it.
I presume you use the setImage function to display the image when you have it available ...

Anyone out there done this successfully?
If so, I'd really appreciate knowing how you did it. :?

cheers
paul


For this message Paul has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: September 10th, 2007, 4:57 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Paul,

This is rather an annoying problem because you'd think that you should be able to pull data from the Internet given that we do it everyday whilst browsing. I'm afraid that the Post & Get Data commands won't achieve this aim.

I can think of two ways that the above commands should help, but unfortunately don't. I might be incorrect on these counts and hopefully somebody will jump in an steer me on the correct path.

The Post and Get are for sending / receiving variables from a CGI (PHP / ASP) and therefore could pull BLOB data from an online database. However, I don't think that Opus script can handle blobs or store image data of any kind within a variable (I might be wrong).

The second alternative is to use the Post command to call a PHP / ASP function that some how downloads the image file. This isn't quite as daft as it sounds, as PHP certianly has built in FTP facilities but this also seems a no go area as, for security puposes, you can't download a file from a remote server to a local machine because the PHP script is on the server. If you're running a server locally, then you might have more success as in theory this method should work.

However, if you're not, then my remaining attempt actually did work although I figure you could do this two ways both involve using a local FTP program that accepts parameters. Basically, and the simplist way would be to launch a DOS FTP program that accepts the parameter of the image file (plus username / password) and the local store directory. You can then simply point your image object to this location.

There are various DOS programs available for FTP and Microsoft DOS actually has a FTP client built-in. Alternatively, you should be able to do this with a DLL (in Opus VI) but as WINIP (too complex) is the only 'free' version I could find, I've been unable to test this. There are several commericial FTP DLLs on the market which should accomplish this.

Given the inclusion of the new update feature in Opus, I think if anybody can find a suitable FTP DLL then this process would prove extremely useful as publications could automatically download and install thier latest update automatically.

To have a play with DOS' own FTP type FTP -help in the CMD window.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: September 10th, 2007, 7:21 pm 
Offline

Joined: November 11th, 2004, 4:05 am
Posts: 636
Location: Christchurch, NZ
Thanks Mack,
I appreciate your comments; you've obviously been putting some thought into this.
I was thinking of using PHP or a dll, but I would also need to write XML parsing functions and workaround the lack of regular expressions to get things working.
For the next few projects it will probably be easier for me to use a different multimedia app that has the required functionality built in.

cheers
Paul


For this message Paul has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: June 16th, 2009, 2:23 pm 
Offline

Joined: January 19th, 2005, 5:15 pm
Posts: 83
Location: Netherlands
Old subject, but i use the free wget for this.
With the function Launchfile, and some arguments i can download files from the internet.


For this message Reemski has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: June 16th, 2009, 3:36 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
It's a very useful program and probably good for personal programs but the I'm never really sure whether the strong copyleft of GPL would result in the same licensing conditions being applied to the derived Opus publication using the application.

Long term, being able to pull graphics directly into Opus from the web and access database blobs will become more necessary. IMHO.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Load image from internet at runtime
PostPosted: February 26th, 2011, 3:05 am 
Offline

Joined: July 12th, 2009, 10:33 am
Posts: 124
Hi
Has there been any advancement on this in the last couple of years? I'm happy to display images directly from the internet rather than downloading them (although I just had a thought that IE stores a copy in a temp file locally, but this sounds a bit unpredictable). I need the auto-resize functionality of the image object so can't use a browser.
Would appreciate thoughts on the best way to achieve this now.
Ta
Dan

_________________
V9.6. Windows 10. Testing on PC, Mac, iPad.


For this message dan1 has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Load image from internet at runtime
PostPosted: February 26th, 2011, 1:45 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
No. There's nothing built-in to Opus. But then I'd image, that a local application would still have to download from a remote source so it's going to get cached somewhere whether it's an Opus system, using IE or custom application / DLL that handles the transaction.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Load image from internet at runtime
PostPosted: March 15th, 2012, 5:27 pm 
Offline

Joined: May 25th, 2008, 4:57 pm
Posts: 355
Location: Ireland
Opus: Pro 9.75
OS: Windows 10
System: MacBook Pro (Intel 2020)
Just looking at this issue, trying to figure out best way for end user to download files for use in a publication, be it images or updates.

Using a browser object seems to be the only real option built into Opus at the moment, although it can be confusing for the end user.

Although I am interested in wget, looks like an option that might work. Has anyone used cURL either?

_________________
Opus Pro 9.75 on MacBookPro (2020 Intel) running Parallels 19 with Windows 10 (x64)


For this message lmc has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Load image from internet at runtime
PostPosted: March 15th, 2012, 6:38 pm 
Offline

Joined: May 25th, 2008, 4:57 pm
Posts: 355
Location: Ireland
Opus: Pro 9.75
OS: Windows 10
System: MacBook Pro (Intel 2020)
Hi All,

I am testing using Wget.exe to download files from the web into the publication directory.

I can use the file launch action and select wget.exe and set the url as the parameter to download, but the user is presented with an "Open File Security Warning", etc.

To get around this I was hoping to use DOS cmd.exe to do it all via that so the user might see a flicker of a cmd console and that would be it. This is the code I'm working with, it launches the CMD window, but that's it, how do I get CMD to take a command?


Code:
var FileURL = "http://www.url.here"

var Fname = SYSTEM_WINSYS_DIR + "cmd.exe";
var Params = SYSTEM_PUBLICATION_DIR + "wget.exe " +  FileURL;
LaunchFile(Fname, Params);



Thanks in advance.

_________________
Opus Pro 9.75 on MacBookPro (2020 Intel) running Parallels 19 with Windows 10 (x64)


For this message lmc has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Load image from internet at runtime
PostPosted: March 19th, 2012, 5:47 pm 
Offline

Joined: May 25th, 2008, 4:57 pm
Posts: 355
Location: Ireland
Opus: Pro 9.75
OS: Windows 10
System: MacBook Pro (Intel 2020)
Anyway to make wget.exe execute in the background without prompting the user at all?

_________________
Opus Pro 9.75 on MacBookPro (2020 Intel) running Parallels 19 with Windows 10 (x64)


For this message lmc has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Load image from internet at runtime
PostPosted: March 19th, 2012, 11:28 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
The security warning is not from wget. It is because your trying to launch wget from a network location. Just run it from a local drive and it works fine.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Load image from internet at runtime
PostPosted: March 20th, 2012, 10:53 am 
Offline

Joined: May 25th, 2008, 4:57 pm
Posts: 355
Location: Ireland
Opus: Pro 9.75
OS: Windows 10
System: MacBook Pro (Intel 2020)
Thanks Mack.

But it is being run locally, I get this Windows UAC pop up in Windows 7, see screenshot.


Anyway not to have this appear via Actions or Scripting?


Thanks.


You do not have the required permissions to view the files attached to this post.

_________________
Opus Pro 9.75 on MacBookPro (2020 Intel) running Parallels 19 with Windows 10 (x64)


For this message lmc has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Load image from internet at runtime
PostPosted: March 20th, 2012, 9:29 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Oh, unsigned files :-)


Try this:

Code:
cmd.exe /c wget http://styledip.com/wp-content/uploads/2011/11/fish-2.jpg


Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


For this message mackavi has been thanked by : lmc


Top
 Profile Visit website  
 
 Post subject: Re: Load image from internet at runtime
PostPosted: March 21st, 2012, 12:14 pm 
Offline

Joined: May 25th, 2008, 4:57 pm
Posts: 355
Location: Ireland
Opus: Pro 9.75
OS: Windows 10
System: MacBook Pro (Intel 2020)
Thanks Mack,

Got it working now. No user prompt for permission, it goes and downloads automatically. You're a star.

Code:
var FileURL = "http://styledip.com/wp-content/uploads/2011/11/fish-2.jpg"
var Fname = SYSTEM_WINSYS_DIR + "cmd.exe";
var Params = SYSTEM_PUBLICATION_DIR + " /c wget.exe " +  FileURL;

LaunchFile(Fname, Params);



Mack we must all chip-in and get you a gift, as you're the #1 support guy on this forum.

_________________
Opus Pro 9.75 on MacBookPro (2020 Intel) running Parallels 19 with Windows 10 (x64)


For this message lmc has been thanked by : mackavi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 34 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group