I use angularjs to get a string from a web service. This string is actually a base64 pdf file.
public string Get(int id)
{
var bytes = File.ReadAllBytes(@"C:\test.pdf");
var content = Convert.ToBase64String(bytes);
return content;
}
Angularjs return me a array like this one:
{"0":"\"","1":"J","2":"V","3":"B","4":"E" ...}
But I need a complete string like this : "JVBE..."
I try to find a way to get the complete string instead of array format and I don't find anything.
Do you know how handle this?
Thank you!
Karine
Angular JScode here.. either noJavascript... It looks like you are mixingJava & Javascript. There is novarkeyword in Java and so noFile.ReadAllBytes()function inJavascript. YourGetfunction must return an error at execution/compilation..varin C#). But you're right anyway, no JS here at all :)