GetBytesUserAlreadyHasUsed() function missed

May 23, 2009 at 1:36 AM

GetBytesUserAlreadyHasUsed() method missed .

And How do I literal the files in the flash uploader by server side ?

I have looked through the uploader's attributes , But I cann't find the attributes .

Coordinator
May 23, 2009 at 1:46 AM

Sorry man but I have no idea what you are asking. Bytes user has used? You mean bytes uploaded?

May 23, 2009 at 3:22 AM

protected void FileNameDetermining(object sender, FileNameDeterminingEventArgs args)
{
    long bytesUsed = GetBytesUserAlreadyHasUsed();
    if(bytesUsed + args.File.ContentLength > MAX_ALLOWED_STORAGE){
      args.CancelProcessing = true;
      HttpContext.Current.Response.StatusCode = 550;
    }
}
 bold font part ,the method should get the current file size of the filelist , How can I get the upload files collection through the uploader .

 

thanks.

Coordinator
May 23, 2009 at 4:59 AM

Ah, ok, well this is something you have to write yourself. Ideally you should store in a database the name, size, type of each file and in this function you will be getting the sum of all file sizes, somethiong like SELECT SUM(Size) FROM UploadedFile