Solved

Preview for files on MySql Query

Posted on 2012-03-29
5
297 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 108

Accepted Solution

by:
Ray Paseur earned 250 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks Ray_Paseur,

I'll look into the options.
0
 

Author Comment

by:Jacko_Pinto
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now