我想在不知道空间账号密码的情况下上传(那是不可能滴),所以最后我想用asp弄一个上传的功能,提供一个post接口给Delphi来实现提交。
如:post('http://127.0.0.1/up.asp?接口=C:\123.gif'); 上传C盘123.gif到asp所在目录。
希望大大满足一下,呵呵,我找了半天都没找到代码。
只需要asp(无组件,asp基础差,代码越简单越好),post功能我自己可以写。
如:post('http://127.0.0.1/up.asp?接口=C:\123.gif'); 上传C盘123.gif到asp所在目录。
希望大大满足一下,呵呵,我找了半天都没找到代码。
只需要asp(无组件,asp基础差,代码越简单越好),post功能我自己可以写。
解决方案 »
- 请问 raize listview 为什么不能在列头 显示 图标???????????????????????急!!!!!!!!!!!
- 过程定义问题 procedure WMPaint(var Message: TWMPaint); message WM_PAINT;
- 我在做考勤系统,我想找合适的有关日程安排的控件
- 求可以读出计算机所有硬件的代码,并且可以写入数据库
- RBuilder怎样做分组报表,如http://www.xbwl.cn/1.gif
- 提示invalid float point operation,谢谢
- 自定义组件的事件,在调用是出错,高手请进
- PageControl里TabSheet的大小调整?
- 郁闷的问题?=------------在线等待
- 用ADOTable怎样快速定位到指定的某个记录上,如第二条记录,而不用增加字段,也不用知道该记录的任何记录内容。
- 睡觉前发帖,明早结帖
- 求救,ADOQuery的问题!!!
以前做的一个例子,用ASP上传图片到服务器IIS目录,这个方案有个小bug就是上传图片时速度不能太快如果太快就会出现某些图片不能完全上传成功。将
-----------------------------u.asp下面内容保存成u.asp
将------------------------------upfile文件,注意这个文件没有扩展名 下面内容保存成upfile
这是无组件上传的asp
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdHTTP, StdCtrls,IdMultiPartFormData;type
TForm1 = class(TForm)
Button1: TButton;
IdHTTP1: TIdHTTP;
OpenDialog1: TOpenDialog;
procedure Button1Click(Sender: TObject);private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
res : String;
ms : TIdMultiPartFormDataStream;
h: TIdhttp;
f:string;
begin
if Opendialog1.Execute then
f:=Opendialog1.FileName;
if f='' then exit;
try
ms := TIdMultiPartFormDataStream.Create;
h := Tidhttp.Create(nil);
ms.AddFile('file1',f,'');
idhttp1.Request.ContentType := 'multipart/form-data' ;
res:=h.Post('http://www.oro.com/Admin/u.asp?menu=up',ms);
if res='上传成功' then
Application.MessageBox('图片上传成功!','提示',MB_OK+MB_ICONASTERISK)
else
Application.MessageBox('图片上传失败!','ERROR',MB_OK+MB_ICONSTOP);
finally
ms.Free;
end;
end;
end.
if Request("menu")="up" then
On Error Resume Next
Set upl = Server.CreateObject("SoftArtisans.FileUp")
set FileUP=new Upload_fileFileUP.GetDate(-1)
formPath="../UpLoad/ProImages/BigPicture/"
set file=FileUP.file("file1")
filename=formPath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&"."&file.FileExt
if LCase(file.FileExt) <>"gif" and file.FileExt<>"jpg" and file.FileExt<>"swf" thenresponse.Write("<script>alert('不支持该文"&filename&"件上传!');history.go(-1);</script>")
response.End()
end ifselect case LCase(file.FileExt)
case "gif"
img=""
case "jpg"
img=""
case "swf"
img="[flash]"&cluburl&"/"&filename&"[/flash]"
case else
error2("对不起,本服务器只支持GIF、JPG、SWF格式的文件\n不支持 "&file.FileExt&" 格式的文件")
end selectfile.SaveToFile Server.mappath(filename)
response.Write("上传成功")
set FileUP=nothing
response.endelse%>
<body topmargin=0>
<table cellpadding=0 cellspacing=0 width=100%>
<form enctype=multipart/form-data method=post action=u.asp?menu=up>
<tr><td>
<input type=file style=FONT-SIZE:9pt name=file1 size="30"> <input style=FONT-SIZE:9pt type="submit" value=" 上 传 " name=Submit>
</td></tr></form></table>
<%end if
%>
看我的博客吧,里面写得很细
http://hi.baidu.com/perock/blog/item/ad2826f133282da5a40f5215.html
比如很多论坛里发贴可以上传附件,难道发贴者知道你空间密码吗?用asp我研究过,但没成功。但用C#与delphi结合,实现了。本来想把代码贴出来,但楼主只给这一点分,肯定是对问题不够重视,我自然也就没有动力帮楼主解决问题了。