locked
Need help checking for image on harddrive and if not found use a default image RRS feed

  • Question

  • User-781935974 posted

    Im using fpdf to output details about an employee and an image of the employee if one is found. I have it setup to get the employee id from user input then send that id to the fpdf where it pulls the employee data from the db and display it on the pdf. So far I have a few pictures and renamed them to the same id of the employee the pictures are of. so if employee id is 534 his picture is named 534.jpg. Everything is working so far but for the employees that I do not have a picture of yet the pdf will not load. So Im hoping someone can help me write a script that will check if that picture is in the folder and if not display a default picture. Here is a sample of the code:

    Dim techpic2 
    techpic2 = eID &".jpg" 
     
     
     
    pdf.Image techpic2,90,38,27,0," " 
    

    Im hoping I can write a scipt something like

    if techpic2 = Not Found THEN 
     
    techpic2 = "default.jpg"; 
    

    But I am not sure how to check a folder for a file or the correct syntax, if anyone knows this I would really appreciate it.

    Monday, June 21, 2010 7:20 PM

Answers