Welcome Guest Search | Active Topics | Sign In | Register

Downloaded item file names missing after updating from 16.1.32 to 16.1.75 Options
James
Posted: Wednesday, August 24, 2016 11:29:58 AM
Rank: Advanced Member
Groups: Member

Joined: 2/11/2015
Posts: 122
I've been attempting to update from my current version of EO WebBrowser, 16.1.32 to the newest version 16.1.75
However, after updating the drivers a number of downloads now function incorrectly.

I've been retrieving the filename from the DownloadItem object by using Path.GetDirectoryName and Path.GetFileName on the DownloadItem.FullPath property.

For downloads in which this was previously filled out, this value is now blank.
Some downloads do present a content disposition, but this requires parsing on my end which should really be parsed into the DownloadItem.
For other downloads there is no value to construct an initial file name off of.

Can the functionality that previously filled the FullPath property be re-introduced, or added in addition to whatever functionality replaced it?
James
Posted: Wednesday, August 24, 2016 12:02:03 PM
Rank: Advanced Member
Groups: Member

Joined: 2/11/2015
Posts: 122
I've worked around this issue, and it may turn out that the cause of this is a little more complex.
In my code, I add a BeforeDownload EventHandler.
In this handler, I do some work to discover filenames and paths, resolve issues with naming conflicts etc.
After I conduct the resolution I pass the results back into the args

Code: C#
void WebView_BeforeDownload(object sender, BeforeDownloadEventArgs e)
{
var di = e.Item;
var myResolvedFilePath = "";
/*Do some stuff to figure out a file Path*/
e.FilePath = myResolveFilePath;
var myDownloadVM = new DownloadViewModel(di);
DownloadManager.Add(myDownloadVM);
}


I then construct a viewModel around the DownloadItem which reads DownloadItem.FullPath

Perhaps there is a transfer of data that is no longer occurring, or is occurring differently, between the DownloadItem and the EventArgs?
I'd like to understand what changed so I can feel confident that my local code changes will fully resolve the issue.

eo_support
Posted: Friday, August 26, 2016 7:55:27 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi,

e.Item.FilePath is not filled when BeforeDownload is fired because the "Save As" dialog has not been displayed yet at that point. After the "Save As" dialog is displayed (or you choose to explicitly provide a file and skip the dialog), the DownloadUpdated event will be fired and at that point e.Item.FilePath will be filled.

Thanks!
James
Posted: Friday, August 26, 2016 8:29:30 AM
Rank: Advanced Member
Groups: Member

Joined: 2/11/2015
Posts: 122
How was it populated before the update?
e.Item.FilePath was previously filled by the same code on my end, and we did not display a file dialog.
eo_support
Posted: Friday, August 26, 2016 9:26:31 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi,

I am not sure why it would work in older versions --- it's not supposed to. The only file name that is available in BeforeDownload event is e.FilePath. This is the "suggested" file path that you can override. The actual path taken won't be reflected in DownloadItem object until after this suggested path is taken, which would occur after BeforeDownload event.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.