Solved

Verifying uploaded document made the trip

Posted on 2013-05-29
1
237 Views
Last Modified: 2013-05-29
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
Comment
Question by:lateapex
1 Comment
 
LVL 40

Accepted Solution

by:
Kyle Abrahams earned 500 total points
ID: 39206103
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

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question