English 中文(简体)
Problems with formdata send via Adobe Reader to a php-script
原标题:

I have created a PDF with Adobes LifeCycle and added some forms and a button to send the formdata to a php-script. On the serverside i grab the postdata and store them into a database. No problem so far, but the Adobe Reader now complains about an error something to do with the content of the text/html type.

Here is the error message in german:

Beim Senden ist ein Fehler aufgetreten. Inhalt des Typs text/html kann nicht verarbeitet werden.

and in english:

An error occurred during the submit process. Cannot process content of type text/html.

Do i have to write some data in the output of the php-script so the reade knows everthing is okay?

最佳回答

I ve found the solution, i have to set the content-type to application/pdf and read out a thank-you pdf :). Now the Adobe Reader stops complaining and i have a kind of feedback to the user...

问题回答

Another solution is respond with application/vnd.fdf with a message. The following the java code but it has the sample fdf to send a message back to Acrobat Reader.

String userAgent = request.getHeader("user-agent");

if (userAgent.toUpperCase().startsWith("ACROFORMS")){
  response.setContentType "application/vnd.fdf");
  out.println("%FDF-1.2
"+"1 0 obj<< /FDF << /Status (Form has been submitted!) >>      >>endobj
"+
"trailer
"+
"<< /Root 1 0 R >>%%
");

}else
 ....

return value in the AspnetMvc

String userAgent = Request.Headers["user-agent"];

            if (userAgent.ToUpper().StartsWith("ACROFORMS"))
            {
                Response.ContentType = "application/vnd.fdf";
                Response.Write("%FDF-1.2
" + "1 0 obj<< /FDF << /Status (Form has been submitted!) >>      >>endobj
" +
               "trailer
" +
               "<< /Root 1 0 R >>%%
");
            }




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签