Jump to content

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


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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.