[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 244
  • Last Modified:

Verifying uploaded document made the trip

Environment:
Dot net web service
C# win form client

Experts,

I've got a windows app that allows users to save .pdf files and then upload them to a web service. How can I verify the document successfully uploaded? I've got control over the client and the web service.

Thanks!
0
lateapex
Asked:
lateapex
1 Solution
 
Kyle AbrahamsSenior .Net DeveloperCommented:
The service can return a true or false when it's done with the file saving.  

(pseudo code only)
<webMethod()>
public string SaveFile(byte[] filestream)
try
{
  savefile(filestream);
  return "true";
}
catch (Exception ex)
 {
   return ex.Message;
}  


anything other than "true" would be an error.

If you want double verification, just create a check method:

Client: ValidateFlie(filename);

Server:
public bool ValidateFile(string filename)
{
 string path = "c:\";
 if (System.IO.Exists(path + filename)
  return true;
 
return false;
}
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now