How to Check Images File Exist? in different server

Hi,
I have 10 different coldfusion server.
for example 9 server is for the web application site - for
example
http://myserverone/studentweb
the other one is for images website, just for displaying
student picture - for example
http://myserverimage/studentpicture.
the purpose of this website is to display student picture
that i store as gif files.
from my studentweb website i will call the images from
studentpicture website as source for my image placeholder.
for example this is my code i'm calling form
http://myserverone/studentweb
website:
<img src="
http://myserverimage/studentpicture/#studentnumber#.gif"
alt="" name="studentpicture" width="160" height="200">
my problem is, if there is no specific student picture in my
studentpicture website, then the placeholder will display an X (
mean the images not found )
how do i prevent the X to display?
how do i using coldfusion or any kind of way to check if the
images exist on that website ( different server ), so if the images
is not found, i can display a default images? i can do this if i'm
calling the website in the same server, but not using a different
server.
this is like using other website images for your own personal
website and sometimes the owner delete the images from their
website, and i want to display my own images if that images been
removed from the source website.
anyone have done this before?
thanks for suggestion and guide...
haire

1. Use CFHTTP with method="HEAD".
2. See, if the HTTP status code is 200.
The head-method is of course more efficient, as it doesn't
need to "get" the message body. However, a status code of 200 is
possible even when the requested image file is no longer on the
server.

Similar Messages

  • How to check whether file exist or not?

    hello,
    i wanted to know that how can i check whether a file exist or not independent of underlying Operating system?
    please help .
    Thank you.

    Use exists() on a File instance.

  • How to check whether file exist in a folder at the application server

    Hi to all experts.
    if suppose there is a file at the application server test.txt my requirement if the one more file is created of the same name before overwriting the file a warning message is to displayed to the user that the file already exist .
    how to do it

    HI Mohammed,
    use The FM DX_FILE_EXISTENCE_CHECK
    or static class CL_GUI_FRONTEND_SERVICES=>FILE_EXIST
    For more info
    search file in application server
    application server
    hope it helps you.
    Regards!

  • URGENT!!! how to check whether file exist or not on client side?

    hello,
    i am building appilication using JSP and javabeans.
    Problem is my application is like on server files are there for say colors and their corresponding car image in that color.so when i move my mouse over that particular color ,its corresponding car image is displayed.
    now say someone has deleted that corresponding car image file but image of color is there...........
    so i have to handle such excpetion.
    like if corresponding car image for that color is not there then that color image should also not be displayed.
    i dont want to do this checking on server side.
    pls help me!!!!!!

    You don't have access to the client files. It is a security violation in a normal internet environment. Imagine what people could do to your computer if they could see everything on it.

  • How to check image files for their integrity?

    Dear People,
    I am having new problems with aperture foto sync on my iphone.
    Just suddenly, iTunes started compling that certain fotos werent copied to the phone because the phone cannot display them.
    now - those pictures are just regular camera jps. they show absolutely now problem when displayed in the finder or aperture or iphoto. they HAVE been copied to an iphone before!
    So i wonder what is going on?
    Maybe my library is corrupted again?
    You should know that i allready spent hours and hours rebuilding my library because it had some strange behaviour, so i did restore it by hand two or three times.
    so know one guess is: maybe some photos are corrupted and corrupt the library? but all photos seem to work normal. so maybe i need some programm which checks them?
    clueless,
    thanks for help
    PS: lion, aperture and iPhone are ALL the newest version/OS

    And its getting worse: i checked now that i can display AND sync those images with iPhoto perfectly normal - so it seems AGAIN my aperture library is corrupted somehow.
    Of course I did perform all repair operations etc

  • Spry:if image file exists?

    Hi,
    is there a easy way to test if an image file exists on the server? I try to generate dynamic html listing names and pictures. The names (and other info) arein a xml file. For some, images exist on the server as name.jpg file. I'd like to check with spry if name.jpg file exist and if take it as picture, if not use a general placeholder.
    thanks for any hlep,
    thorsten

    Hi Ben,
    thanks for your time and effort helping. I'd really appreciate this.
    How is the XML-file compiled eg from a database or coded by hand
              I use both on my web site and It would be nice if the solution would work both
                   - with a query send to our institutes phone book. Results are in xml format
                   - and a local xml file, that has been edited by hand.
    Is there a serverside program you use eg PHP, ASP, Coldfusion
              I can use PHP or javascript, but php does not work in combination with server-side-includes that we use on our apache web server. I'd prefer javascript, because those script run on any page, even if SSI is used.
    Have you considered using an HTML table to retrieve the info instead of using XML
              No yet, because also the local xml file is basically identical to the query output. I just add some fields manually to the local xml file. (So I could add a "picture" entry, but this solution would not work with the xml online query).
    Is there anywhere where I can view your code
              The page is already online, the goal is to eliminate the non-existing picture links. This page queries a local xml file
              http://lch.web.psi.ch/webcontent/EduTeach/students.html
              I did a similiar thing using php on other pages of the site. This page queries a phonebook database using the xml output. It is written in php, which does not work with our server when SSI is used. The workaround is to include a html page generated by a php scirpt using iframe. I'd really would love to replace this php script by a spry/javascirpt combination.
              http://lch.web.psi.ch/webcontent/research/surface/Gruppe.html
    I attach the html file and php file for the two pages. Thanks, best, t.

  • How to test if a image file exists???

    Hi ppl,
    heres my problem...im using servlets and jsp and i only ever want to access the jsp file from a redirect in the servlet. Problem arises however if the user trys to access the jsp file directly in which case all the relative links on the page are no longer in the same context as if they were accessed via the servlet.
    i wanna have some kind of test on my jsp page which displays an error page if the user has access the page directly but im not sure the best way to go about this.
    i was thinkin about tryin to determine if an image file exists using a relative link...in which case if the relative links where off then it wouldnt.
    Any suggestions on the best way to do this...or if there might be a better way to test such a case?
    any advice much appreaciated.
    Mycall

    I would suggest moving all jsp's that you dont want the user to have direct access to under the WEB-INF directory. This way they would only be able to access it through your servlet.
    Hope this helps

  • How to test an image file existing or not

    Hi Everyone,
    I want to test whether an image file exists or not before setting the url of an image component in JSF to it. Following is my code:
    File testFile = new File(image_path + "/p1.jpg");
    if(testFile.exists()){
    info("file exists");
    }else{
    info("file not exists");
    this.myImage.setUrl(image_path+"/p1.jpg");
    Althoug the p1.jpg can be linked to myImage, the existence test always fails. That is, I got the message "file not exists" even though it is already displayed.
    What did I do wrong?
    Thanks in advance,
    Message was edited by:
    field

    File testFile = new File(image_path + "/p1.jpg");Is image_path an absolute path or relative path?

  • How to Check a file in the directory..

    Dear,
    Pl. do suggest me how to check a file (e.g. abc.txt) is in the directory (say d:\Print).
    Do tell me how to check whether this file is exist in the directory or not???
    Thanx in Advance.
    Bhavesh

    Hi
    You can use Win_Api_Utility.Copy_File cmd. IF the file does not exist r the file was not copied to the destination properly, it will raise no_data_found error. See Forms help - Find option for syntax & more details.
    I've used it & works well.
    Regards
    APK

  • How to save image files into SQL Server?

    Hello, All:
    Does anyone know how to save image files into SQL Server? Does the file type have to be changed first?? Please help me! Thank you!

    You need a BLOB field (usually)... Then you can check this tutorial out:
    http://java.sun.com/developer/onlineTraining/Database/JDBC20Intro/exercises/BLOBPut/
    There are other exercises on that site, including one on reading the images back.

  • How to check any directory existance in TestStand?

    How to check any directory existance in TestStand?
    Is there TestStand function? Or other option without writing my own code in external program (e.g. LabVIEW or C)?
    Thanks in advance
    Solved!
    Go to Solution.

    At Least according to the NI TestStand 2012 documentation, Engine.FindPath and Engine.FindFile work only within the NI TestStand SearchDirectories.
    Maybe related: remote paths (\\server\path\to\file.ext) are considered "invalid" by Engine.FindPath.

  • How to check amsilent file in Sun Access manager patch or redeploying WAR's

    h1. How to check amsilent file in Sun Access manager patch or redeploying WAR's
    I had a hard time getting all the passwords correct, so I wrote a shell (bash) script that uses most passwords and other parameters in searches and queries. It let's you know before you start if a value is wrong. It does not change anything, only queries.
    h2. One pitfall I found ...
    during the postinstall of patch 05. I told Sun about it, but I suspect it was too late and is also an issue with patch 06:
    Look at the documentation regarding amconfig and the amsilent file:
    http://docs.sun.com/app/docs/doc/819-2137/adsav?l=en&q=amconfig&a=view
    Two problems that are clear to me now:
    1. ADMINPASSWD in practice, this password is used for cn=puser, not amadmin as it says. Perhaps there is something that makes them the same. It was the same for me, so it probably does not matter.
    2. AS81_ADMINPASSWD is not the same as ADMINPASSWD using either my definition or the document's definition. However, in the amsilent template, it is set like this, which I found is incorrect and the cause of my recent hair loss:
    <blockquote>AS81_ADMINPASSWD="$ADMINPASSWD"</blockquote>
    Also, this one if you use the web server:
    <blockquote>WL8_PASSWORD="$ADMINPASSWD"</blockquote>
    Delete the $ADMINPASSWD and replace it with the password for the app/web server.
    h2. The Script.
    It tests for the above problem, but I just realized it does not check $ADMINPASSWD. If that is set incorrectly in your amsilent, you'll get errors immediately from amconfig, so no big deal. If you make improvements, please post a reply!
    Paste this into a file named checkamsilent. LDAP and appserver must be running. It reads /opt/SUNWam/amsilent. Run it as root or use sudo:
    sudo ./checkamsilent
    #!/usr/bin/bash
            echo "This will test several important parameters of the amsilent file "
            echo "run this as root."
            echo "### read in the amsilent parameters"
            echo "source /opt/SUNWam/amsilent  "
    source /opt/SUNWam/amsilent
            echo "### look for the *server port* with LISTNER, otherwise it's not listening. "
            echo "netstat -a | grep $SERVER_PORT    "
            echo "--------------"
    netstat -a | grep $SERVER_PORT  
            echo "--------------"
            echo "."
            echo "### *admin port* with LISTNER, otherwise it's not listening. "
            echo "netstat -a | grep $ADMIN_PORT   "
            echo "--------------"
    netstat -a | grep $ADMIN_PORT 
            echo "--------------"
            echo "."
            echo "### Expect to see a line of XML, otherwise the SERVER_PORT is incorrect in the amsilent file."
            echo "grep $SERVER_PORT  ${AS81_INSTANCE_DIR}/config/domain.xml  "
            echo "--------------"
    grep $SERVER_PORT  ${AS81_INSTANCE_DIR}/config/domain.xml
            echo "--------------"
            echo "."
            echo "### Expect to see a line of XML, otherwise the ADMIN_PORT is incorrect in the amsilent file."
            echo "grep $ADMIN_PORT  ${AS81_INSTANCE_DIR}/config/domain.xml "
            echo "--------------"
    grep $ADMIN_PORT  ${AS81_INSTANCE_DIR}/config/domain.xml
            echo "--------------"
            echo "."
            echo "### bind as the directory manager "
            echo "ldapsearch -v -h $DS_HOST -p 3892  -L -s sub -D \"$DS_DIRMGRDN\" -w \"$DS_DIRMGRPASSWD\" -b 'dc=nsf, dc=gov' \"cn=amldapuser\"" 
    ldapsearch -v -h $DS_HOST -p 3892  -L -s sub -D "$DS_DIRMGRDN" -w "$DS_DIRMGRPASSWD" -b 'dc=nsf, dc=gov' "cn=amldapuser" 
            echo "."
            echo "### check the amldapuser password. "
            echo "ldapsearch -w $AMLDAPUSERPASSWD -v -h $DS_HOST -p 3892  -L -s sub -D cn=amldapuser,ou=DSAME Users,dc=nsf,dc=gov -b ou=DSAME Users,dc=nsf,dc=gov cn=* cn  "
    ldapsearch -w "$AMLDAPUSERPASSWD" -v -h $DS_HOST -p 3892  -L -s sub -D "cn=amldapuser,ou=DSAME Users,dc=nsf,dc=gov" -b "ou=DSAME Users,dc=nsf,dc=gov" cn=* cn
            echo "."
            echo "### check the app server admin: AS81_ADMIN password: AS81_ADMINPASSWD  and port: ADMIN_PORT "
         echo "### That's actually a bug in the template.  "
         echo "### Do not use AS81_ADMINPASSWD=\$ADMINPASSWD  Make sure they are  different passwords! Don\'t use the default!"
         echo "Expect to see a WARNING about --password option. "
            echo "/opt/SUNWappserver/appserver/bin/asadmin  list-http-listeners --user $AS81_ADMIN --port $ADMIN_PORT  -w $AS81_ADMINPASSWD  "
    /opt/SUNWappserver/appserver/bin/asadmin  list-http-listeners --user $AS81_ADMIN --port $ADMIN_PORT  -w "$AS81_ADMINPASSWD"
            echo "done!"

    I change the product machine from LG optimus to Samsung Galaxy but the file writing is not working, too.
    I copied the source code from Adobe website about FileStream  but it is needless too.
    -----------------program code------------------------
    import flash.filesystem.*;
    import flash.filesystem.FileStream;
    import flash.events.Event;
    //txtFld is a standard textField component
    txtFld.text = "Start";var file:File = new File();
    //btnSaveFile is a standard button component
    btnSaveFile.addEventListener(MouseEvent.CLICK,handlerBtnSaveFile);
    function handlerBtnSaveFile(e:Event){
    txtFld.text = "Pressed";
    file = File.documentsDirectory;
    file = file.resolvePath("test.txt");
    var fileStream:FileStream = new FileStream();
    fileStream.openAsync(file, FileMode.WRITE);
    fileStream.writeUTFBytes("Hello");
    txtFld.text = file.nativePath.toString();
    //fileStream.addEventListener(Event.CLOSE, fileClosed);
    fileStream.close();
    fcnFileName();
    function fcnFileName(){
    txtFld.text = file.name.toString();
    function fileClosed(event:Event):void {
        trace("closed");
    txtFld.text = "FileClosed";

  • How  to check  table have  exists any views in oracle

    hi,
    how to check table have exists any views in oracle

    SELECT * FROM user_dependencies
    WHERE type='VIEW'
    AND referenced_type='TABLE'
    AND referenced_name ='Your_Table_Name' You may use dba_dependencies to find views in different schema.

  • How to send image file through mail without   any attachment

    Plz tell  me how to send image file through mail without any attachment  ( i mean not converting  that image into pdf or any format )  i want to send that text or image  through mail .

    Hi Sandeep,
    I think you can setup the type of email in Shared office Settings in transaction S016.
    There is an option called <Preset document classes>
    You choose this pushbutton to branch to the maintenance screen for the document classes that are directly displayed to users in the Business Workplace for selection when they use the Create function. The name under which the documents are displayed can also be maintained.
    http://help.sap.com/saphelp_nw70/helpdata/en/6c/69c30f418d11d1896e0000e8322d00/content.htm
    Haven't tried it though.
    Regards,
    Siddhesh

  • How to check image size in oracle 9i & 10g database

    hi,
    i have inserted an Image into a table in oracle database & I want to View the Query How to check image size in oracle 9i & 10g database
    thanks
    Edited by: user8920919 on May 30, 2010 1:43 AM

    user8920919 wrote:
    hi,
    How to check image size in oracle 9i & 10g database
    thanksWhat do you mean with "image size"?

Maybe you are looking for

  • Controling the 'name' of a file download

    function openPDFWordTwo(thisObj,pdfURL){ //For Opening Word formTitleId = thisObj.id.substr(0,thisObj.id.lastIndexOf(':')) + ":hiddenFormTitle"; formTitle = document.getElementById(formTitleId).value; window.location = pdfURL;    return false;Here is

  • Deleting Duplicates - Apple dropping the ball for almost 11 years now.

    I have searched extensively on this "knowledge" base, but the "genius"es here have had no meaningful input.  Just the hollow suggestions that: 1: I sort the files by date added and simply delete the later files, silly.             Answer: No. 2. I go

  • Change resolution based on dpi in flex

    Hi All ,     In my Flex Application , i am getting image for chart / process from java. Its working fine. Now my new requirement is : 1) For the first time when getting image the default dpi should be  : 72dpi 2) And i should have 2 more options to s

  • How can we set default IM status?

    We are implementing convergence for our users and the initial reaction has been very positive. However, one feedback item has been that the IM client always defaults to the status of "Available." There doesn't appear to be a way in preferences to hav

  • Smartform Borders

    Hi Friends, In Smartform main window i'm using tables. Now my problem is that the framed pattern is working but lower/upper/right/left frame is not working. in individual table cells also I've give lower frame but it's not working. Thanks & Regards,