|
Rank: Advanced Member Groups: Member
Joined: 2/11/2016 Posts: 35
|
How can I know that a file is uploaded to the server? In a chrome browser displays file upload progress in the bottom left corner. I need events about file upload success, can you help me?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
I do not think there is any interface for that. Sorry about it!
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 5/9/2016 Posts: 84
|
If there is no interface maybe you can detect the parent process that uses your component and detect if it is using the file? http://stackoverflow.com/questions/317071/how-do-i-find-out-which-process-is-locking-a-file-using-netThen we can at least tell when the upload is completed? Not perfect but maybe a workaround?
|
|
Rank: Advanced Member Groups: Member
Joined: 2/11/2016 Posts: 35
|
well, now I use this code for it, but maybe you can create more frendly event from the code:
Code: C#
internal void BeforeSendHeaders(object sender, RequestEventArgs args)
{
foreach (var postDataItem in args.Request.PostData)
{
if (postDataItem.Type != PostDataItemType.File)
{
continue;
}
Console.WriteLine("Start upload file {0}", postDataItem.FileName);
}
}
internal void AfterReceiveHeadres(object sender, ResponseEventArgs args)
{
foreach (var postDataItem in args.Request.PostData)
{
if (postDataItem.Type == PostDataItemType.File)
{
Console.WriteLine("Finish upload file: {0}", postDataItem.FileName);
}
}
}
|
|