Jump to content

Calling a file when you don't know the proper extension?!


suess0r

Recommended Posts

Hiya,

 

Alright here's the schematics of what i'm trying to do..

 

1. I wrote an upload script which only allows certain file types and has a maxsize on it.

-- They are being stored in /files/new/

 

2. My next page I want to display the image in a thumbnail. But a fairly larger one where I can specify my own dimensions (ie: 50% x 50%) depending on the type of print it is. When the image is displayed I'm looking to add a CSS dotted border around it.

--Here's the key with the dotted border - I would like to print the border INSIDE the image 1/2" from the outside of the border. Showing the bleed space that would be if you printed the design from a printshop.

 

Here's how i'm displaying the image now

<?php

    $filename = $_POST['name'];

    $filename .= '.gif';

    echo "<img src='../files/new/".$filename."' width='50%' height='50%'>";

?>

 

As you can see I'm assuming that it's a .gif extension - when in reality it could be .gif, .jpg, or .png. Is there anyway that I can make a call to the server to pull the file with the file named $filename without the extension? This is currently my problem so far that I would like to address and would appreciate any input on how to work-around this!!

 

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.