Sending Addition Info To uploadUrl

Last post 10-26-2011, 6:14 AM by fmortara. 3 replies.
Sort Posts: Previous Next
  •  09-23-2011, 12:27 PM 70181

    Sending Addition Info To uploadUrl

    This is what I currently have:
     
    $uploader = new PhpUploader();
    $uploader->MultipleFilesUpload = true;
    $uploader->InsertText = "Upload Pictures";
    $uploader->MaxSizeKB = 10240;
    $uploader->AllowedFileExtensions = "*.jpg,*.png,*.gif,*.bmp,*.psd";
    $uploader->InsertButtonID = "picUpload";
    $uploader->UploadUrl = "ur_pic_upload2.php";
    $uploader->Render();
     
    What I need, is for more information to be posted to ur_pic_upload2.php. For example, I need to send it an ID number when a picture is uploaded. In a form, I would just go:
    <input type="hidden" name="var" value="1838540"> 
  •  10-02-2011, 9:11 PM 70260 in reply to 70181

    Re: Sending Addition Info To uploadUrl

  •  10-05-2011, 7:10 AM 70290 in reply to 70181

    Re: Sending Addition Info To uploadUrl

    Hi,
     
    I suggest you use cookie to pass the value.
     
    We will improve this part in the future.
     
    the more advanced way is using JavaScript ,
     
    get the uploader object , and use
     
    uploader.SetClientData("yourdata");
     
    at server handler code for validation, you can use $_POST["_AjaxUploaderClientData_"] to get that value.
     
    Regards,
    Terry
  •  10-26-2011, 6:14 AM 70527 in reply to 70181

    Re: Sending Addition Info To uploadUrl

    Kevan:
    This is what I currently have:
     
    $uploader = new PhpUploader();
    $uploader->MultipleFilesUpload = true;
    $uploader->InsertText = "Upload Pictures";
    $uploader->MaxSizeKB = 10240;
    $uploader->AllowedFileExtensions = "*.jpg,*.png,*.gif,*.bmp,*.psd";
    $uploader->InsertButtonID = "picUpload";
    $uploader->UploadUrl = "ur_pic_upload2.php";
    $uploader->Render();
     
    What I need, is for more information to be posted to ur_pic_upload2.php. For example, I need to send it an ID number when a picture is uploaded. In a form, I would just go:
    <input type="hidden" name="var" value="1838540"> 
    You can send it via GET
     
    $uploader->UploadUrl = "ur_pic_upload2.php?value=YOUR_DATA";
     
View as RSS news feed in XML