I\'m trying to create the wcf service which will upload the files like pdf,doc,xls,images but pdf, txt files are uploading and opening properly but when i\'m trying to uploa
try byte array instead of stream and wrapping the class like this:
public class Input
{
[DataMember]
public string fileName { get; set; }
[DataMember]
public byte[] fileContents { get; set; }
}
then simply write the file on disk like this:
public string Upload(Input input)
{
File.WriteAllBytes(input.fileName, input.fileContents);
return "OK";
}