0

upload.php

Does anyone have an upload.php file that works with the zipper/uploader example? I cant seem to get it working.

by
16 Replies
  • Tim,

    Try this for upload.php:

    CODE
    <?php
    error_log(print_r($_FILES, 1), 3, "/tmp/upload.log");
    ?>


    After uploading, check to see if there are any results in "/tmp/upload.log".

    Also, is uploading enabled on your PHP installation? Some php config vars to check:

    CODE
    ; Whether to allow HTTP file uploads.
    file_uploads = On
    ; Maximum allowed size for uploaded files.
    upload_max_filesize = 2M


    Let us know if you get it working,

    Steve Spencer
    0
  • I can get uploads to work to an "uploads" folder I have set the permissions on with just a simple form and a PHP uploader.
    The error I get with the Yahoo sample is actually in IE. It says "Uploading" but then I get an error message at the bottom "Error on page" when I click on that it says the error is at the start of this line:

    elZip.innerHTML = "<pre>" + res.value.body + "</pre>";

    I am using the same code from the Yahoo example.

    The file never gets uploaded.
    0
  • If I comment out that line, I get:

    "Uploaded! Result:"

    and no error, but nothing uploaded.
    0
  • Looking at the log file, it looks like your files are uploaded with the default 'file' name. In PHP, you are using 'userfile'. Two ways to fix this:

    CODE
    // 1. change references in upload.php from this:
    // $_FILES['userfile']['name']
    // to
    // $_FILES['file']['name']

    // -- OR --

    // 2. change your HTML/JS to set this config parameter:
    // BPTool.Uploader.create("uploader", { fileVarName: 'userfile' }).render();
    0
  • Thanks Steve, It works now.

    How can I get around the 2 meg file limitation?

    Thanks,
    Tim


    QUOTE (steven_spencer @ May 19 2009, 12:28 PM) <{POST_SNAPBACK}>
    Looking at the log file, it looks like your files are uploaded with the default 'file' name. In PHP, you are using 'userfile'. Two ways to fix this:

    CODE
    // 1. change references in upload.php from this:
    // $_FILES['userfile']['name']
    // to
    // $_FILES['file']['name']

    // -- OR --

    // 2. change your HTML/JS to set this config parameter:
    // BPTool.Uploader.create("uploader", { fileVarName: 'userfile' }).render();
    0
  • Upload size is specified in your php config file. For example, to bump it up to 10MB:

    CODE
    ; Maximum allowed size for uploaded files.
    upload_max_filesize = 10M



    QUOTE (tim_hoehn @ May 19 2009, 01:39 PM) <{POST_SNAPBACK}>
    Thanks Steve, It works now.

    How can I get around the 2 meg file limitation?

    Thanks,
    Tim
    0
  • I still get that "Unknown Runtime Error" from IE at the start of this line:

    elZip.innerHTML = "<pre>" + res.value.body + "</pre>";
    0
  • I think that is an IE6 weirdness ... try replacing the line with this:

    elZip.innerHTML = res.value.body;



    QUOTE (tim_hoehn @ May 19 2009, 02:01 PM) <{POST_SNAPBACK}>
    I still get that "Unknown Runtime Error" from IE at the start of this line:

    elZip.innerHTML = "<pre>" + res.value.body + "</pre>";
    0
  • QUOTE (steven_spencer @ May 19 2009, 03:05 PM) <{POST_SNAPBACK}>
    I think that is an IE6 weirdness ... try replacing the line with this:

    elZip.innerHTML = res.value.body;


    This is IE7
    0
  • QUOTE (tim_hoehn @ May 20 2009, 06:52 AM) <{POST_SNAPBACK}>
    This is IE7


    Still gives an error. And I have noticed sometimes the file doesnt get uploaded.
    0
  • QUOTE (tim_hoehn @ May 20 2009, 07:23 AM) <{POST_SNAPBACK}>
    Still gives an error. And I have noticed sometimes the file doesnt get uploaded.


    Could be a problem with GoDaddy.com web hosting.

    Is it possible to zip and upload 2 seperate files with this?
    0
  • In the zipper code example, you can select multiple files from the Open file dialog. Those files are zipped into a single ZIP file. We also have an upload tool that allows you to drag+drop and select files multiple times.


    QUOTE (tim_hoehn @ May 22 2009, 11:16 AM) <{POST_SNAPBACK}>
    Could be a problem with GoDaddy.com web hosting.

    Is it possible to zip and upload 2 seperate files with this?
    0
  • What about encrypting the zip file with a password. Is this a feature you might add?

    QUOTE (steven_spencer @ May 22 2009, 03:10 PM) <{POST_SNAPBACK}>
    In the zipper code example, you can select multiple files from the Open file dialog. Those files are zipped into a single ZIP file. We also have an upload tool that allows you to drag+drop and select files multiple times.
    0
  • QUOTE (tim_hoehn @ May 27 2009, 06:45 AM) <{POST_SNAPBACK}>
    What about encrypting the zip file with a password. Is this a feature you might add?


    We haven't considered adding zip encryption. What's your use case?

    Note that we're in the process of open sourcing BrowserPlus. This will give the community a chance to add features like this.

    Steve
    0
  • It will be a web site that will allow users to zip, encrypt, and upload source code files.

    What open source license will you be using?
    0
  • QUOTE (tim_hoehn @ May 28 2009, 08:20 AM) <{POST_SNAPBACK}>
    It will be a web site that will allow users to zip, encrypt, and upload source code files.

    What open source license will you be using?


    No final decision, but something like BSD or MPL.

    Steve
    0
This forum is locked.

Recent Posts

in Support & General Questions