File (.PDF) for Ajax/Webmethod Webforms

Asked

Viewed 36 times

2

I wonder how do I get the information from a pdf file (Binary, name, size)

 public class Arqs: IHttpHandler
{

    Funcoes f = new Funcoes();

    public void ProcessRequest(HttpContext context)
    {
        try
        {

            context.Response.ContentType = "text/plain";
            var httpPostedFile = HttpContext.Current.Request.Files["Up_File"];

It has as I access this file through my ajax?

var data = new FormData();
data.append("Up_File", oFiles[oItem]);

$.ajax({
    url: 'Arqs.ashx',
    data: data,
    processData: false,
    contentType: false,
    cache: false,        
    type: 'POST',
    success: function (data) {

I want to pass this information from the file more others to this other method:

 $.ajax({

    type: "POST",
    contentType: "application/json; charset=utf-8",
    url: "alt_de_dados.aspx/Atualiza_dados",
    data: JSON.stringify(DTO),
    dataType: "json",
    success: function (data) {
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.