Solved

Preview for files on MySql Query

Posted on 2012-03-29
5
302 Views
Last Modified: 2012-04-16
Hello Experts,

I'm running a simple query to display data from forms onto HTML pages.  

I'm looking for a way to display a "preview" of the file that's getting uploaded using the forms. Forms have these fields: Date, name, author, description and upload file (files are stored on database).  The type of files that are getting uploaded are: PDF, DOC, XLS, JPG, GIF, MPG4 and SWF.

The idea is that on the HTML pages, other than the other info,  visitors are also able to see a small "preview" of the uploaded file.

How can I do this? Thanks!
0
Comment
Question by:Jacko_Pinto
  • 2
  • 2
5 Comments
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 250 total points
ID: 37788265
There is not any really good answer for this question, especially if you want to accomplish this in real time.  If you have a web page that displays the information you may be able to get something from this site.  It has worked for me in the past, though not in real time.
http://www.shrinktheweb.com/

My general recommendation for something that can provide a fairly good UX would be to have 32x32 pixel icons that represent the different types of files.  You can display the icon and make it a link to a new window that access the uploaded file.  The client already knows what she uploaded, and the icon and link serve to provide an easy way to verify that the upload worked correctly.

Failing that you might be able to try to stuff the uploaded file into a small <div> or iframe.  But I do not think I would be comfortable with that approach.

Best of luck with it, ~Ray
0
 
LVL 37

Expert Comment

by:CyanBlue
ID: 37788422
Maybe generating a thumbnail images per upload with PHP or any other server side script would be an alternative?

CyanBlue
0
 

Author Comment

by:Jacko_Pinto
ID: 37788912
Thanks Ray_Paseur,

I'll look into the options.
0
 

Author Comment

by:Jacko_Pinto
ID: 37788919
Thanks CyanBlue,

Can you please suggest a script that might work best for this?

Regards.
0
 
LVL 37

Assisted Solution

by:CyanBlue
CyanBlue earned 250 total points
ID: 37791641
As far as I am aware, there is no one script that can do all that, and honestly, I am not sure if you can create thumbnails from all those file types you've mentioned.

My suggestion is google for something like 'php create dynamic thumbnail from image' and learn the techniques that you need to do the job and then find other classes that supports other file formats.

CyanBlue
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question