Upload Complete and Browse Button Disable

Dec 26, 2008 at 2:25 PM
We are using your utility for uploading to Amazon (Amazon Direct) and there a couple of overlooked items that we would like to find out how to add:
  Upload complete indicator - right now the uploader notifies % complete to 99% then when its done the indicator just disappears - how can we make it so it notifies the user that the upload was successful?
  Browse Button disable - currently we only want to allow one upload per "session", so when the upload is complete we would like to also disable the browse button??

Any assistance here would be appreciated.

Dec 26, 2008 at 6:01 PM
Here is how you can use client events to understand when the upoad if finished

Dec 26, 2008 at 6:05 PM
Use also OnConfirmUpload event to set a session variable that will prevent the uploader to be visible next time user reloads the page

Dec 27, 2008 at 8:45 AM
Using client side events we can check for file state, can you please suggest any way to disable the browse button after uploading file without reloading the page?

Requirement : Once I upload file successfully the browse button should get disabled.
Dec 27, 2008 at 6:59 PM
We don't want to allow the client side code to be able to control the UI logic, as this could be abused by hackers.

But one thing you can do is:

function FileStateChanged(uploader, file, httpStatus, isLast){
    Flajaxian.fileStateChanged(uploader, file, httpStatus, isLast);
    if(file.state == Flajaxian.File_Uploaded){
        var uh = Flajaxian.$("UploaderHolder");
    var ud = Flajaxian.$("UploadDone");

uh.style.display = 'none';
ud.style.display = 'visible';

} } </script> <div id="UploaderHolder"> <fjx:FileUploader JsFunc_FileStateChanged="FileStateChanged" runat="server" > <Adapters> <fjx:FileSaverAdapter Runat="server" FolderName="UploadFolder" /> </Adapters> </fjx:FileUploader>


<div id="UploadDone">
You have uploaded your file


Dec 27, 2008 at 7:01 PM
And of cource also use this event http://www.flajaxian.com/flajaxian.com/DirectAmazonUploader1.0Help.html#HowToSaveFileNameToDatabase  to set up a session var that would prevent accepting upload for this session.
Aug 26, 2009 at 7:25 AM


First of all I'm impressed by this control - nice work mate :)

I have a similar problem kmkeen... What I'm trying to achieve is:

- Allow only one file to be uploaded (done)

- Disable the file list box (done)

- Fire an event ONLY when a file is selected (done - I just hooked to JsFunc_GenerateFileRow)

- Disable the Browse... button so users can only upload (not done !!! I'm struggling).

- Disable upload button once the upload is complete (done).

I can see that "We don't want to allow the client side code to be able to control the UI logic, as this could be abused by hackers." So should i give up?

Alternatives I may be seeing are:

> Causing a postback on file upload so I can control the position of the browse button and make it, say, X-position = -100

> Edit the source flash scripts to allow for this behaviour.

Any help will surely be appreciated!!


Aug 26, 2009 at 8:50 AM

You can always recompile flash so when you have call to this.setButtons(false, false, true); in /flash/Classes/com/flajaxian/FileUploader2.as if your condition is met add also
this._browseBtn.visible = false;
this._uploadBtn.visible = false;
this._cancelBtn.visible = false;

Don't forget that after you recompile Flash you also have to recompile the .NET project so the Swf file is embeded in the DLL