Normal Topic Using a Pic on the Server (Read 781 times)
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Using a Pic on the Server
Sep 9th, 2015 at 11:08pm
Print Post Print Post  
Hey folks,

I'm upgrading my database, and I'd like it to do something simple, like have a client session access a picture file on my Linux server's Pics directory.  However, I'm stumped. 

I can use the @ServerListDirectory("/home/manager/Desktop/Sesame/Pics") and see the .png file I want to access, but when I try to have my splash page have a picture field = the full string (ie.:

SplashLogo = "/home/manager/Desktop/Sesame/Pics/SplashLogo.png"

It won't call my server's data.  Is there a better way to do this?

Thanks!
  
Back to top
IP Logged
 
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Re: Using a Pic on the Server
Reply #1 - Sep 10th, 2015 at 3:41pm
Print Post Print Post  
Okay ... slightly better question. I've uploaded the splash logo to our website ... so how can I tell the splash screen to access the .png file located on the web?

Thanks!
  
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Using a Pic on the Server
Reply #2 - Sep 10th, 2015 at 5:09pm
Print Post Print Post  
Not sure if you can get an image from the web to work as the splash image directly. I believe you need to put a local copy on each workstation (or have it on the server, and accessible via a mapped drive or a UNC path).
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Re: Using a Pic on the Server
Reply #3 - Sep 10th, 2015 at 10:49pm
Print Post Print Post  
Hmmm ... mapping the server is problematic, as we have some remote/WAN network users.

Can anyone think of some @shell coding that would pull the .png image from the internet to a local file directory?
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Using a Pic on the Server
Reply #4 - Sep 10th, 2015 at 11:01pm
Print Post Print Post  
If using @Shell (or any of the other commands like that), you can use wget or Curl to download the image.

You might also be able to get @HTTPGet to download an image file, though you would need to decode it from base64 to binary.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Re: Using a Pic on the Server
Reply #5 - Sep 11th, 2015 at 2:11am
Print Post Print Post  
OK!  I managed to work out an option for resolution ... it won't work on Linux clients, but it's probably unlikely.

Here's what I wrote ...

Code
Select All
if FileExists("C:\sesame2\pics\KDCLogo.png")
{
	KDCLogo = ".\Pics\KDCLogo.png"
}
Else
{
	p = @chr(34) + "powershell -command " + @chr(34) + "& { (New-Object Net.WebClient).DownloadFile('http://kingstondc.com/wp-content/uploads/2015/09/KDCScreenLogo-226x300.png', 'c:\sesame2\pics\KDCLogo.png') }" + @chr(34)
	n = @Shell(p)
	KDCLogo = ".\Pics\KDCLogo.png"
}

 

  
Back to top
IP Logged