Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-21-2011, 02:15 PM
jamitsu89 jamitsu89 is offline
Registered User
Join Date: Jun 2011
Posts: 27
jamitsu89 is an unknown quantity at this point
Checking if an image is uploaded to the server

Hey,

Is it possible to check if an image is uploaded to the server?

For example,

Graal Script Code:
  ---
  new 
GuiShowImgCtrl("Ach_IconImage") {
    
0;
    
image "ach_image.png";
    
this.height this.width 32;
  }
  --- 
Then I require a check for if that image is uploaded, so that if it isn't I can set the image to "ach_noimage.png".

Thanks in advance,

Caleb.
Reply With Quote
  #2  
Old 08-21-2011, 03:13 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
You can use fileExists() on the serverside to see if the file is uploaded to the server. I think the function only takes a filename, not a full path to the file.
__________________
Reply With Quote
  #3  
Old 08-21-2011, 05:04 PM
jamitsu89 jamitsu89 is offline
Registered User
Join Date: Jun 2011
Posts: 27
jamitsu89 is an unknown quantity at this point
Lovely. Thanks a lot.
Reply With Quote
  #4  
Old 08-21-2011, 07:26 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
I think there's function on the client to check image width and height which you might be able to use (an image that doesn't exist should have a width/height of 0)
__________________
Reply With Quote
  #5  
Old 08-21-2011, 07:50 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by salesman View Post
I think there's function on the client to check image width and height which you might be able to use (an image that doesn't exist should have a width/height of 0)
There's getImgWidth and getImgHeight. They can be used on both serverside and clientside. If you use one of them clientside for a file that is uploaded on the server, but the client doesn't have, it will return zero and then start downloading the file, so it's not the best way to check if a file is on the server (you would have to check again when the file is downloaded).
__________________
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:09 PM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (C) 1998-2008 Linux cyberjoueurs All Rights Reserved.