Welcome to the new Uploadify Community Forums. We've made the switch from PHPBB to Vanilla Forums in hopes of controlling the SPAM more efficiently. We hope this change doesn't suck so much. Also, don't forget to wrap your code in tags. You can quickly insert code using ctrl + f.
I lost some messages that were posted on February 4th. If you posted a message or reply on February 4th, please do so again. Sorry about the inconvenience.
Compression
  • Is there any way of compressing files before upload?? or during the upload?
  • So far as I'm aware compressing files before upload can only be done through JAVA
  • okay thank you. I have just figured out a way of doing it with php as well will post the code when done!
  • ok no the way i found has no use to anyone i will learn some javascript and do it that way thank you.
  • I don't believe you can do it in javascript. I think it needs to be in JAVA (java applet)
  • are you able to give me the code for that? or send me to a tutorial. The things is that i am making a file share website and i want every file that is uploaded, to be compressed and then when called to be downloaded. Uncompressed and ready to download any help would be appriciated
  • I've haven't coded anything for what your asking for. If you google you should be able to find something. I would say it would be easier to use php and compress the file after it as been uploaded. I know this way will increase the amount of data being uploaded, but you are trying to achieve something that needs to be controlled on the clients computer. This will mean you will need to also run the gauntlet of anti-virus software that will think your app is a trojan.
  • Okay thank you soo much you guys will get a donation from me asap....This help has made it so much faster for me to code. Thank you also for the advice i will send over the site when its finished.
  • What do you mean by "compressed"?
    Generally compressing would mean zipping (or equivalent) for non images or with images compressing their quality.
    If you are even asking this question then I would stay away from JAVA if I were you because it wayyyyyyyyyy over your head.

    Lets start with images.
    First of all you can't use compression on a image file (for example 80% on a jpg) and then uncompress it back to 100%, it just doesn't work that way. Well you "could" do it but with bad results.

    Your thinking is completely backwards with this, here is what I would do.

    1. upload the original image and move it to a "staging" folder. For example if I am making a photo gallery I will have a folder tree like below:
    images
    [list]gallery
    [*]thumbs
    [/*:m][*]large
    [/*:m][*]original[/*:m][/list:u]

    So I upload the image and move it into /images/gallery

    2. I leave the file there and I run my code against it to make a thumbnail and place it in the /images/gallery/thumbs folder and then I run my code to make a larger version (usually 640px wide) and make the file and place it in the /images/gallery/large folder

    3. I usually don't keep an original so at this point i delete the original. However in your case you want the original so then instead of deleteing it you would move it to the /images/gallery/original folder

    That way you have a thumb & a large version ready for the web and the original ready for download. it is pretty simple.

    But if I wanted downloadable original images I wouldn't even think of compressing them at upload or at any time.

    I don't use php I use coldfusion but the code for that is simple (this is after the upload code and I would never make it this simple, I would check images for sizes to make sure I'm not making them larger if they are not larger than what I want to make them), this code also assumes you set some variables for locations and with coldfusion you don't need to import any libraries or outside code to do this.. unless it's an older cfm server.


    <cfimage action=\"resize\" height=\"100\" width=\"\" source=\"#strSourceFile#\" destination=\"#destFileThumb#\" overwrite=\"yes\">
    <cfimage action=\"resize\" height=\" \" width=\"640\" source=\"#strSourceFile#\" destination=\"#destFileLarge#\" overwrite=\"yes\">
    <cffile action=\"move\" source=\"#strSourceFile#\" destination=\"#destFileOriginal#\">


    If you want zip it then cfm code would be: (set variables for locations or use absolute paths:


    <cfzip file=\"#strSourceFile#\"\" source=\"#destFileOriginal#\">


    if you want to unzip


    <cfzip file=\"#strSourceFile#\" action=\"unzip\" destination=\"c:images\">
  • Images would be a separate downloading form. I want to compress other files to save space on the server i am going to start off with images but there's no point in compressing them. The main thing is to save space because people might be uploading videos,source code ect... Just like megaupload ect.. but i am going to delete the files after either 2weeks or a month i have not decided that yet. Do you really think itis worth compressing files? i will also be specifying which file they will be able to downloading meaning they wont be able to download any .exe extensions because of viruses. I know i will be getting a lot of traffic and do not want to be uneconomical by not utilizing every avenue available. Any advice would be appreciated. Thank you for the coding i might use it in the near future.
  • It will be a upload/download website. The person will upload a file that they might want to share with people and those people will download the file.
  • ok I would upload the files and have whatever server-side you are using make a new folder for it's contents and come up with a naming convention and like myfiles-04012009-012254-rand#here.. something that will be unique. when the upload is done, then virus check it via command line then zip it up and delete the original folder (because you have the zip). Then use the same name and send it back to user for the link... really it is very simple.

    I would do a tutorial on it but I don't use php and I think you said you did.
  • Yes i do. This is enough info to help me out. Thank you so much.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!