Images to file etentions

Associating images with file extensions

Page 1 of 1

2 Replies - 2469 Views - Last Post: 04 April 2005 - 07:45 PM Rate Topic: -----

#1 Zakynthinos   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 04-April 05

Images to file etentions

Posted 04 April 2005 - 07:00 PM

Hi everyone. I’m new to all this so if anyone could help with a solution or point me in the right direction that would be great. I’m creating a site that uses ASP and MySQL. I’m trying to create an upload page so when the end-user uploads a file or an app it returns them to another page that has the record entered and sorted e.g. the new page which will display all the previous records uploaded and in the format of : pdf.gif, filename “invoice.pdf”, description, date uploaded and finally a link to the file for it to be downloaded download.gif. I know this is a multi part process but any assistance especially with the code of returning an image associated to the file would be great.

Is This A Good Question/Topic? 0
  • +

Replies To: Images to file etentions

#2 skyhawk133   User is offline

  • Head DIC Head
  • member icon

Reputation: 1960
  • View blog
  • Posts: 20,409
  • Joined: 17-March 01

Re: Images to file etentions

Posted 04 April 2005 - 07:13 PM

Just to make sure I'm on the same page before I go hunting, do you need the image to be a preview of the file (not sure if this can be done automatically) or just a graphic for say... the mime type... just like in windows, the icons next to each file type.
Was This Post Helpful? 0
  • +
  • -

#3 Amadeus   User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 250
  • View blog
  • Posts: 13,507
  • Joined: 12-July 02

Re: Images to file etentions

Posted 04 April 2005 - 07:45 PM

I'm assuming you just want to display a graphic of the particular file type next to a file of that type. Assuming you have all the images, something like the following should suffice:
if InStr(".pdf") <> 0 then
   file_image = "pdf.gif"
elseif InStr(".doc") <> 0 then
   file_image = "doc.gif"
elseif
   'you see where I'm going with this
else
   'you're default image
end if


I may have misunderstood the question, and apologies if this is so.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1