Howdy, Stranger!

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

Simpler integration with existing sites
  • After struggling for several hours to integrate uploadify in my existing site, I decided to give up and look for another solution.

    An ideal uploadify should behave exactly like the "file" input it replaces. So, for example, if I have the following form:

    <form id='form2' method='post' action='go.php?to=my_photo' enctype='multipart/form-data'>
    <input name='form' type='hidden' value=\"upload_photo_form\" />
    <input id='new_photo' name='new_photo' type='file' />
    <input type='submit' name='submit_button' value='Upload' />
    </form>

    I should be able to do:

    $('#new_photo').uploadify({
    'uploader' : 'uploadify.swf',
    'auto' : true,
    'multi' : false
    });

    And it should just replace the input field with the uploadify uploader, while the behaviour of the form remains the same.

    Specifically:
    * When I click my old "submit" button, the form with the files should be actually submitted to the form "action" (in this case: go.php?to=my_photo), just as it was before I switched to "uploadify".
    * There should be no need to specify the "method" and the "script" arguments, as they are already specified in the form.
    * The name of the variable in the $_FILES array should remain the same, without having to specify it using the fileDataName argument.
    * If the "action" prints something, I should see what it prints, just as when posting the original form.
    * If the "action" doesn't print anything and just redirects to another page, the redirect should happen, and it should not get stuck ...
  • Because they are two different things, 1 is an upload 1 is a form submit.


    * When I click my old "submit" button, the form with the files should be actually submitted to the form "action" (in this case: go.php?to=my_photo), just as it was before I switched to "uploadify".

    Well it needs to upload the file first and return the info, so your form would need to do that in order, well it doesn't have to but you would need a lot of coding to over come this.

    * There should be no need to specify the "method" and the "script" arguments, as they are already specified in the form.

    Again it is a separate process so yes it does need to know.

    * If the "action" prints something, I should see what it prints, just as when posting the original form.

    Then you need to return the info you want to see. The plugin isnt made your your exact specs it's made to handle a large variety and it just passes the uploaded temp file off to your system and you take it from there and then it reports back what you tell it to, it doesn't automatically know what specifics you want or what web platform or scripts you use, that's your job as a developer.

    * The name of the variable in the $_FILES array should remain the same, without having to specify it using the fileDataName argument.

    The flash file that does the upload needs a specific name name to use so unless you dig into the flash src file and add your wizardry to make it figure out any of the zillion or so names it could have that you need to live with it.

    * If the "action" doesn't print anything and just redirects to another page, the redirect should happen, and it should not get stuck ...

    The flash file needs an answer back form processing page for normal use at which point you can use a oncomplete function to do your forwarding.

    After struggling for several hours to integrate uploadify in my existing site, I decided to give up and look for another solution.

    Good luck with that!!!! I have tried them all and ended up back here, although swfupload has a reg form example that you might like but I have a hunch you won't like how the code is for it.

    An ideal uploadify should behave exactly like the "file" input it replaces. So, for example, if I have the following form:

    why? Most people don't want that kinda of function they want it better, if you want that function then just use the reg one.

    In your case what you want to do is what I do and that is to make it into 2 separate processes (which is what they all should be doing anyways). Click on browse button and get image and upload it and have uploadify put the final returned value in a hidden form field and then when they actually submit the form you sumbit it as normal.