English 中文(简体)
Lynx removes newline characters from post_data input
原标题:

I am trying to post a file to a URL via the MS-DOS command prompt. I am using the Lynx browser to do this. I am able to post my file just fine, but all of the newline characters are removed by Lynx before creating the POST request. Is it possible to post a file via command line without having the newline characters removed? The command I am running is:

lynx -post_data http://www.myserver.com/myscript.pl < testfile.txt

The input file, testfile.txt, looks like this:

test=This

is

a

test.;
---

The data that actually gets sent across the wire looks like this:

test=Thisisatest.;
最佳回答

I actually found cURL to be a far better utility to post a file via MS-DOS.

问题回答

I believe that you need to have your special characters URLENCODED for this to work. According to this Lynx page:

Forms most commonly are submitted to http servers with the content encoded as ENCTYPE="application/x-www-form-urlencoded" for analysis by a script, and Lynx treats that as the default if no ENCTYPE is specified in the FORM start tag. However, you can specify a mailto URL as the form s ACTION to have the form content sent, instead, to an email address. In such cases, you may wish to specify ENCTYPE="text/plain" in the form markup, so that the content will not be encoded, but remain readable as plain text.

This means that spaces become %20 and newlines become %0A





相关问题
Compilers for DOS32?

Where can I get BASIC and C/C++ Compilers for MS-DOS?

GUI paradigm history

I know that Apple and Microsoft were inspired by Xerox PARC in building the GUI, but my question is: from the hardware point of view, which was the switch to GUI become available? I remember that I ve ...

Batch File to Delete Folders

I found some code to delete folders, in this case deleting all but n # of folders. I created 10 test folders, plus 1 that was already there. I want to delete all but 4. The code works, it leaves 4 ...

Help with DOS script (grab specific data from a file)

I need to grab just the md5 value from a file and make it a variable which I can use to compare to another md5 value. The problem is this file looks like this: a7393f772e34ca16a5854e80d9ec6704 md5 ...

DOS Database - help needed to recognize what is it

today I got a copy of an old system from which I need to import data. The system is written in C and runs in DOS. It uses some kind of database. The file format seems to be rather simple(1 file = 1 ...

View ram in DOS

Is there a way in dos (im using a dos boot disk on a linux machine) to view portions of ram? ie. some form of command to read the binary at a given address? edit: my bootable floppy doesnt have ...

Lynx removes newline characters from post_data input

I am trying to post a file to a URL via the MS-DOS command prompt. I am using the Lynx browser to do this. I am able to post my file just fine, but all of the newline characters are removed by Lynx ...

热门标签