This question is locked. New answers and comments are not allowed.
I am curious how i would set the uploadHandler so once the last bit of the file is uploaded to the server the upload handler calls file.move(target,source) so that i can then move the file to my final location. The reason i need this is due to another service on my server, a filesystem watcher.
Due to the nature of chunked uploading my filesystem watcher goes crazy if I upload directly to the final location. I thought i had this worked out but I don't think its writing the last chunk before moving the file as filesize is always smaller than the original.
Due to the nature of chunked uploading my filesystem watcher goes crazy if I upload directly to the final location. I thought i had this worked out but I don't think its writing the last chunk before moving the file as filesize is always smaller than the original.
public override bool SaveChunkData(string filePath, long position, byte[] buffer, int contentLength, out int savedBytes)
{
string tempPath;
tempPath = @"_tmp/_update";
tempPath = System.Web.HttpContext.Current.Server.MapPath(tempPath);
if (IsFinalFileRequest())
{
File.Move(tempPath, filePath);
}
return base.SaveChunkData(tempPath, position, buffer, contentLength, out savedBytes);
}