Home > Back-end >  It's driving me crazy, dear master, please grant instruction! Be urgent!
It's driving me crazy, dear master, please grant instruction! Be urgent!

Time:10-12

Why don't upload the file, it is 17.6.1.99 this server in 11 this folder is not 123. Doc files, browser and enter the address to 'http://17.6.1.99:8888/11/1.asp' is normal, also is not an error!
The unit Unit1;

Interface

USES the
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Idhttp, URLMon IdMultipartFormData StdCtrls;
Const UpUrl='http://17.6.1.99:8888/11/1.asp'.
Const UpFileName='d: \ 123. Doc;
Type
TForm1=class (TForm)
For: TButton;
Procedure Button1Click (Sender: TObject);
Private


{Private declarations}
Public
{Public declarations}
end;

Var
Form1: TForm1;

Implementation

{$R *. DFM}

Procedure TForm1. Button1Click (Sender: TObject);
Var
MutPartForm: TIdMultiPartFormDataStream;
Response: the string;
FHttp: Tidhttp;
The begin

FHttp:=Tidhttp. Create (nil);
FHttp. HandleRedirects:=true;
FHttp. AllowCookies:=true;

MutPartForm:=TIdMultiPartFormDataStream. Create;
MutPartForm. AddFormField (' the act ', 'upload');
MutPartForm. AddFormField (' upcount ', '1');
MutPartForm. AddFormField (' filepath 'and' data ');
MutPartForm. AddFormField (' file1 '=' ' ' 'filename + UpFileName + "' ");
MutPartForm. AddFormField (' Submit ', 'Submit');
MutPartForm. AddFile (' file1, UpFileName, 'text/plain');
Try
Response:=FHttp. Post (UpUrl MutPartForm);
Messagebox (0, PAnsiChar (response), "ca", MB_OK);
The finally
MutPartForm. Free;
FHttp. Free;
end;

end;

End.

CodePudding user response:

Please pass by, help me to look at, what needs to be done on the server configuration

CodePudding user response:

Web server default asp file upload is not allowed in, so need to related web server configuration,

CodePudding user response:


refer to the second floor WZCXZ response:
default asp file upload is not allowed in the web server, so need to related web server configuration,

It seems to, are generally not FTP upload,

CodePudding user response:

What's your web server?

CodePudding user response:

With asp page first test to see can upload,
At the same time open httpwatch monitoring asp page

CodePudding user response:

1. The asp is the end of file upload web applications?
It has been configured to executable? Directory permissions can read and write is also the process of web account?

CodePudding user response:

Try to change the upload file type,,
MutPartForm. AddFile (' file1, UpFileName, 'multipart/form - data);
FHttp. Request. ContentType:=MutPartForm RequestContentType;
  • Related