Click here to Skip to main content
15,912,977 members

Comments by Indhukanth Pv (Top 4 by date)

Indhukanth Pv 12-Dec-14 6:31am View    
i need to download some files from remote server.
and on my db table i have some file path,hash value,status etc corresponding to each entry.
i need to download these files to my local machines to temp folder and need to check the hash set corresponding with the db table.. if it is equal then create the directory if not exits and paste this into the local path and also i will update the table field status to "Done". then go for the next...
Indhukanth Pv 8-Dec-14 0:39am View    
can i call service public Stream RetrieveFile(string path) using this code inside from my code??
but using (var response = request.GetResponse()) what actually return??

Indhukanth Pv 7-Dec-14 10:43am View    
is special character in url?
can you briefly explain?
Indhukanth Pv 7-Dec-14 4:46am View    
Hi Tadit,
its showing "A potentially dangerous Request.Path value was detected from the client (:)." my url look likes
http://localhost/FileSync.SyncService/TransferService.svc/RetrieveFile/D:%5CTestFolder%5Citem.zip..

RetrieveFile: is the service contractor ie,
public Stream RetrieveFile(string path)

path : is uri path..

im using another client application which uses following code to download

private void DownLoadFileFromRemoteLocation(string downloadFileLocation, string downloadedFileSaveLocation)
{

string serviceUrl = string.Format("{0}/RetrieveFile/{1}", FileManagerServiceUrl, downloadFileLocation);
var request = WebRequest.Create(serviceUrl);
using (var response = request.GetResponse())
{
using (var fileStream = response.GetResponseStream())
{
CreateDirectoryForSaveLocation(downloadedFileSaveLocation);
SaveFile(downloadedFileSaveLocation, fileStream);
}
}


private string FileManagerServiceUrl
{
get
{
return "http://localhost/FileSync.SyncService/TransferService.svc";
}
}