is it possible to initiate upload in the code behind?

Last post 10-05-2009, 12:32 AM by cutechat. 1 replies.
Sort Posts: Previous Next
  •  10-01-2009, 1:20 PM 56021

    is it possible to initiate upload in the code behind?

    I have a user profile page with information that can be saved with either of 4 different buttons (save, save + Close, Save + New, ...) I would like to use the Ajax uploader to queue up a file for upload and only perform the actual upload after the save function executed by whatever button is pressed is actually run. 
    so i want

    SaveUser();
    if(SaveUserFunctionExecutesProperly && Uploader.HasFile)
    {
         UploadFile();
    }
    can this be done?
    I can't seem to get the order of operations down it always tries to upload first and when I force it to save first it doesnt upload.


  •  10-05-2009, 12:32 AM 56085 in reply to 56021

    Re: is it possible to initiate upload in the code behind?

    Hi,
     
    You can use UploadPersistedFile or UploadAttachment control.
     
    if(UploadPersistedFile1.File!=null)...
     
    if(UploadAttachment1.Items.Count>0)...
     
    Regards,
    Terry
     
View as RSS news feed in XML