Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 31st, 2012, 10:53 AM
einmarbo einmarbo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 1 einmarbo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 49 sec
Reputation Power: 0
Problem with Indy fIdHttp.put method

Hello

i need to upload files to Amazon S3 so i use fIdHttp.put method from fIdHttp Indy Component

fIdHttp.post is not allowed by the server...

during the upload i need to display time needed and a progress bar showing the percentual.

to manage progress bar during upload i have defined:
fIdHttp.OnWorkBegin := IdHTTP1WorkBegin;
fIdHttp.OnWorkEnd := IdHTTP1WorkEnd;
fIdHttp.OnWork := IdHTTP1Work;

then i call the procedure for upload...

....
SetAuthorization (Id_HTTPMethodPut, '', contentType, '', BucketNormal (BucketName) + Name);
fIdHttp.Put (BucketUrl (BucketName) + Name, fStr);
...

the program enter into procedure IdHTTP1Work(ASender: TObject; AWorkMode: TWorkMode; AWorkCount: Int64) until AworkCount >= filesize

and then IdHTTP1WorkEnd (ASender: TObject; AWorkMode: TWorkMode) is fired...

the progress bar is 100% but in reality fIdHttp.post has not finished his work....the upload is still running and terminate after
variable time depending the size of the file. At the end the file is correctly uploaded...

so... my application believe the upload is terminated but this is not true... the upload is still working...

this problem dont happens with download method fIdHttp.get.. the OnWork method is fired when the single stream is received so the progress bar goes right...

i work on Delphi XE2

any suggest?
Many thanks
Einmarbo

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > Problem with Indy fIdHttp.put method

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap