Jump to content

Problem when downloading a file with a Russian name


AGL

Recommended Posts

Hi. Thanks for your work.

 

The problem occurs when working with the server IIS5, IIS7.

In the server standalone mode - file is downloaded successfully.

 

In brouser, i see error message:

"File C:\WebIIS\cache\Start\IotspPxPNzKtXGn\?????.txt not found".

 

verify is possible by modifying the example in a folder:

"Demos\DownloadDemo\"

 

procedure TMainForm.UniButton2Click(Sender: TObject);

var

FName : string;

begin

// FName:='demo'+FormatDateTime('hhnnss', Time)+'.txt';

FName:='текст.txt';

 

UniMemo1.Lines.SaveToFile(UniServerModule.LocalCachePath+FName);

UniLabel1.Caption:='<a href="'+UniServerModule.LocalCacheURL+FName+'" target=new>Click here to download: ('+FName+')</a>';

end;

 

how can I fix this?

Link to comment
Share on other sites

А при чем тут унигуи? Пользователь давит на ссылку с файлом и обработка запроса идет через IIS минуя унигуи, так что копать надо в ту сторону.

Link to comment
Share on other sites

When using TUniFileUpload

  • Create your own folder do not use UniGui.LocalFilePath, ie. DestFolder:=UniServerModule.StartPath+'UploadFolder\';
  • Copy file to UploadFolder from UploadComplete to CopyFile(PChar(AStream.FileName), PChar(DestName), False);
  • Please change direction of slashes from \ to / and use HTTP url format and read http://{url}/Uploadfolder/FName . url should be manually defined to allow domain name in future etc.

Link to comment
Share on other sites

А при чем тут унигуи?

Я конечно догадался, что они тут не причем. Вопрос решил сюда запостить т.к. в унигуи сейчас вожусь.

Вдруг укого были грабли такие.

 

When using TUniFileUpload

 

Thanks, I know, how to use TUniFileUpload.

 

Delphi version?

D2010

 

I know, what the problem is not unigui,

in intraveb-components present a similar problem,

but maybe someone know how to fix it.

 

Now, I see two possible solutions.

- transliterate file names.

- create ftp-server and create download-links in TUniMemo to ftp-server.

Link to comment
Share on other sites

  • 2 weeks later...
  • 9 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...