Preview Uploaded Files

Discussion in 'PHP' started by FishSword, May 2, 2011.

  1. #1
    [FONT=&quot]Hiya,[/FONT]

    [FONT=&quot]I’m currently working on a website that will enable users to upload certain types of files.[/FONT]
    [FONT=&quot]Upon the file(s) being uploaded, I need to generate a preview of the file(s) content, in image format.[/FONT]

    [FONT=&quot]Some of the files I need to upload and generate a preview of include, but are not limited to: .doc(x), .jpg, .ppt(x), .xls(x), .html, .psd.[/FONT]

    [FONT=&quot]Can this be done with PHP?[/FONT]

    [FONT=&quot]Any help is greatly appreciated.[/FONT]
    [FONT=&quot]If you have any queries, please let me know.[/FONT]

    [FONT=&quot]Many Thanks,[/FONT]

    [FONT=&quot]FishSword[/FONT]
     
    FishSword, May 2, 2011 IP
  2. ker

    ker Peon

    Messages:
    97
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #2
    So you want to make something like google docs?
    If yes, you will have to make parser for every of filetypes, and that is very difficult...
    If you want to make screenshots, you have several programs that can do it.
     
    ker, May 3, 2011 IP
  3. FishSword

    FishSword Active Member

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #3
    Hi Ker,

    Thanks for your reply.

    I'm not really trying to create something like Google docs, but am aiming towards taking screenshots of files.
    Is it possible to do this using PHP?

    Many Thanks,

    FishSword
     
    FishSword, May 3, 2011 IP
  4. ker

    ker Peon

    Messages:
    97
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #4
    I'm not sure that it can be done with PHP only, I think you will have to have some other programms installed on server, like ffmpeg or something like that...
     
    ker, May 4, 2011 IP
  5. FishSword

    FishSword Active Member

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #5
    Hi Ker,

    Thanks for your reply.

    I thought this may be the case.
    I've heard that it is possible to develop extensions to php. How easy would it be to build an extension that would generate preview images of files, and can this be done?

    Many Thanks,

    FishSword
     
    FishSword, May 7, 2011 IP
  6. ker

    ker Peon

    Messages:
    97
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #6
    Well, it would be difficult to do that for all files (pdf, ppt, doc, mp4...) in case you are parsing all filetypes. It would be easier to run e.g. OpenOffice.org and take a screenshot... That means you have to have your own server with all programs required to open all files...
     
    ker, May 8, 2011 IP
  7. FishSword

    FishSword Active Member

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #7
    The main file types I would need to generate a preview of, would be doc(x), .jpg, .ppt(x), .xls(x), .html, .psd.
    What would be the problems in generating a preview of these file types?

    I have looked into a website called ZamZar.com, ZamZar enables you to convert different files to different formats (e.g. .doc to .png).
    How would they achieve this functionality? This is sort of what I'm after, in order to generate the previews, though my previews don't need to be as big in dimensions as the results generated on ZamZar.

    Please let me know your thought.s This is all very interesting stuff.
     
    FishSword, May 8, 2011 IP
  8. ker

    ker Peon

    Messages:
    97
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #8
    They are using some other software to convert files, not just php...
     
    ker, May 10, 2011 IP