PHP Script Forums » PHP Classes Support Forum

[sticky] [closed]

PHP / Ajax upload example

(62 posts)
Please support us by buying these products:

  1. Olaf

    Olaf
    PHP Coder

    Hi,

    if you don't get response (image) I guess your pathes are wrong (at least for the output)

    Posted 7 months ago #
  2. User has not uploaded an avatar

    nat.hagey@gmail.com
    Member

    This script is great–but I'm having a hard time installing image magick on leapord running MAMP–any good resources? Or at least a good host that has already imagemagic on it?

    Posted 6 months ago #
  3. Olaf

    Olaf
    PHP Coder

    Hi,

    I got a shared hosting account from www.linkdisk.com , they offer directadmin hosting with imagemagicks is enabled. They are very helpful and their server was always online until now

    Posted 6 months ago #
  4. User has not uploaded an avatar

    nat.hagey@gmail.com
    Member

    Quote from: Olaf
    "Hi,
    I got a shared hosting account from www.linkdisk.com , they offer directadmin hosting with imagemagicks is enabled. They are very helpful and their server was always online until now ;)"

    Thanks Olaf! I'll look them up.

    Posted 6 months ago #
  5. User has not uploaded an avatar

    andrew_answer
    Member

    small fixes needed (at least for Chrome browser which I use):
    - first, in upload4jquery.php you should use different dirs:

    $foto_upload->upload_dir = $_SERVER['DOCUMENT_ROOT']."/upload/";
    $foto_upload->foto_folder = $_SERVER['DOCUMENT_ROOT']."/upload/files/";
    $foto_upload->thumb_folder = $_SERVER['DOCUMENT_ROOT']."/upload/thumb/";

    - second, you should fix JS showRequest function:

    function showRequest(formData, jqForm, options) {
      var fileToUploadValue = document.getElementById('fileToUpload').value;
      if (fileToUploadValue=="") {
        document.getElementById('message').innerHTML = 'Please select a file.';
        return false;
      }
      return true;
    }
    Posted 5 months ago #
  6. Olaf

    Olaf
    PHP Coder

    Hi,

    you say that the "jquery styled" code doesn't work in Chrome?

    var fileToUploadValue = $('input[@name=fileToUpload]').fieldValue();

    Posted 5 months ago #
  7. User has not uploaded an avatar

    bt
    Member

    Hi
    Great code, seems to work after making Chrome changes above although I am on Mac and running Firefox and Safari. Although I get the showRequest results in form page, I do not get anything from showResponse. It uploads the file but it stays quite.

    Posted 4 months ago #
  8. User has not uploaded an avatar

    bt
    Member

    Moreover, sometimes thumbs are created sometimes not.
    Lastly, where do you control the naming convention for files, I want to give my files the session IDs as names.

    Posted 4 months ago #
  9. User has not uploaded an avatar

    bt
    Member

    By the way, I inserted an error object to AJAX request and I keep getting (object Object) as a response from JSON.

    Posted 4 months ago #
  10. Olaf

    Olaf
    PHP Coder

    bt, please open a new thread for your questions and please provide us with an URL

    Posted 4 months ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.