D
Dave
Yesterday I posted:
****************************
I'm trying to download a file from the Web Server to the user's
desktop using myWebClient.DownloadFile as described by Microsoft at
http://msdn.microsoft.com/en-us/library/ez801hhe.aspx.
2 Questions:
1.) Is this the best approach?
2.) Is there a way to have the default download location as the
User's Desktop?
****************************
One thing that I just noticed at the bottom of the MSDN article, and
could explain why it's not working, is:
"FileIOPermission to write the file fileName. Associated enumeration:
Write."
Since I'm not sure how to apply the FileIOPermission example, and the
Write link doesn't work in English...Can someone give me a hand on how
apply this?
My code is:
try
{
string remoteUri = @"http://JCPS/TechVault/Vault/";
string fileName =
FileListGridView.SelectedValue.ToString(), myStringWebResource = null;
WebClient myWebClient = new WebClient();
myStringWebResource = remoteUri + fileName;
myWebClient.DownloadFile(myStringWebResource, fileName);
}
catch (Exception ex)
{
lblStatus.Text = ex.Message;
}
****************************
Thanks
(Please no Advertisements for something to buy)
****************************
I'm trying to download a file from the Web Server to the user's
desktop using myWebClient.DownloadFile as described by Microsoft at
http://msdn.microsoft.com/en-us/library/ez801hhe.aspx.
2 Questions:
1.) Is this the best approach?
2.) Is there a way to have the default download location as the
User's Desktop?
****************************
One thing that I just noticed at the bottom of the MSDN article, and
could explain why it's not working, is:
"FileIOPermission to write the file fileName. Associated enumeration:
Write."
Since I'm not sure how to apply the FileIOPermission example, and the
Write link doesn't work in English...Can someone give me a hand on how
apply this?
My code is:
try
{
string remoteUri = @"http://JCPS/TechVault/Vault/";
string fileName =
FileListGridView.SelectedValue.ToString(), myStringWebResource = null;
WebClient myWebClient = new WebClient();
myStringWebResource = remoteUri + fileName;
myWebClient.DownloadFile(myStringWebResource, fileName);
}
catch (Exception ex)
{
lblStatus.Text = ex.Message;
}
****************************
Thanks
(Please no Advertisements for something to buy)