我用delphi 自带ftp上传文件为啥只能上传英文文件名的资料

yanfeishen79 2008-09-04 10:11:49
我用delphi 自带ftp上传文件为啥只能上传英文文件名的资料
ftp.put(PChar(opendialog1.FileName),filename,FALSE);
上传中文文件名的的就会提示Project GreenOA.exe raised exception class EIdProtocolReplyError with message '/??.doc: Cannot create file错误。
...全文
400 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
chinawcs 2008-09-05
  • 打赏
  • 举报
回复
把你的 文件目录名+文件名 贴出来

我的 ics ftp 上传线程部分代码(仅供参考) 没有问题的


unit FtpPut;

interface

uses
Classes,UMirrorSend,dialogs,SysUtils,idftp;

type
ftpThd = class(TThread)
private
{ Private declarations }
CreateFileName:String;
ProName:String;
protected
procedure Execute; override;
public
constructor Create(StreamFile:String;FilesName:String);
procedure putfile;
end;

implementation

uses Math;

{ Important: Methods and properties of objects in visual components can only be
used in a method called using Synchronize, for example,

Synchronize(UpdateCaption);

and UpdateCaption could look like,

procedure ftp3.UpdateCaption;
begin
Form1.Caption := 'Updated in a thread';
end; }

{ ftp3 }

constructor ftpThd.Create(StreamFile:String;FilesName:String);
begin
CreateFileName :=StreamFile ;
ProName :=FilesName ;

FreeOnTerminate := True;
inherited Create(False);
end;

procedure ftpThd.Execute;
var
fstream: TFileStream ;


begin
try
fstream := TFileStream.Create(CreateFileName,fmOpenRead);
except
//ShowMessage('读取文件出错');
Abort;
end;

{ if not Form1.IdFTP2.Connected then
begin
ShowMessage('err');
fstream.Free;
end;}

try
{ftp1:=TIdFTP.Create(nil);
with ftp1 do
begin
Host :='124.0.0.188';
Port :=23;
Username :='system';
Password :='system';
Connect();
end;}

frmMirrorSend.ftpClient.put(fstream,ProName ,False );

Synchronize(putfile );
finally
fstream.Free;
Terminate ;

end;
{ Place thread code here }
end;

procedure ftpThd.putfile;
begin

//frmMirrorSend.ggFileSend.Progress :=0;
ShowMessage('上传完毕111!');
//frmMirrorSend.lvFileList.Items[2].Caption := '已发送';
{ Place thread code here }
end;

end.




pengxuan 2008-09-05
  • 打赏
  • 举报
回复
换台电脑试试
yanfeishen79 2008-09-05
  • 打赏
  • 举报
回复
上传文件的 目录是C:\Documents and Settings\syf\My Documents\厦门东通道维护制度.doc'
chinawcs 2008-09-04
  • 打赏
  • 举报
回复
文件目录中 不能有 空格 如 : c:\123 456\xx.iso

最好用 ics 控件做个 ftp 简单稳定 不用 indy

另外 当文件大小超过 2G时 就不能上传了 需要该 原代码

lyguo 2008-09-04
  • 打赏
  • 举报
回复
用INDY 中的试一下,
目录不要太长,另外不要有太多的其它字符,如:空格 括号等。
yanfeishen79 2008-09-04
  • 打赏
  • 举报
回复
那要怎么解决?
xabcxyz 2008-09-04
  • 打赏
  • 举报
回复
没有试,从现象猜测是字符集问题,internet的7bit字符集和GB字符集传输出错了.
yanfeishen79 2008-09-04
  • 打赏
  • 举报
回复
还是不行,我用ics写的也是有我问题。。
if ftp1.Connected then ftp1.Quit;
ftp1.Username:='greenway';
ftp1.Passive:=true;

ftp1.password:='';
ftp1.hostname:=';
ftp1.Connect;
if ftp1.Connected=true then
begin
ftp1.LocalFileName:=filedir+filename;
Ftp1.HostFileName:=filename;
ftp1.Put;
end;
这样写好像也是有问题,传上去的文件只有扩展名。。。
YOLOv11人物目标检测数据集 目标类别:['Persona'] 中文类别:['人物'] 训练集:1683 张 验证集:182 张 测试集:0 张 总计:1865 张 该数据集提供了data.yaml文件,内容如下: train: ../train/images val: ../valid/images test: ../test/images nc: 1 names: ['Persona'] YOLOv11城市街头与室内场景人物目标检测数据集 该数据集涵盖了城市街头、商业街区、办公场所及室内生活等多种场景中的人物目标检测,具有广泛的应用价值。通过多样的场景设置和丰富的拍摄角度,能够有效提升模型在复杂环境下的目标识别能力,为智慧城市、安防监控及人机交互等领域提供高质量的训练数据支持。 从数据分布来看,该数据集包含1683张训练集图像、182张验证集图像以及0张测试集图像,整体比例分配合理。训练集与验证集的比例约为9.25:1,能够充分满足模型训练与性能评估的需求,确保模型在不同场景下的泛化能力得到充分验证。 该数据集的标注工作严谨规范,所有图像均经过人工精确标注,每个目标都配有清晰的边界框和统一的标签“Persona”。标注过程遵循严格的标准,确保了数据的高质量和一致性,为后续的模型训练和性能优化提供了可靠的基础。 基于其多样化的场景覆盖和高质量的标注数据,该数据集可广泛应用于智慧城市管理、公共场所安防监控、智能零售分析以及家庭安防等多个领域。特别是在需要精准识别复杂环境中人物的目标检测任务中,该数据集能够显著提升模型的准确性和鲁棒性。

5,943

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧