|
|
|
|
![]() ![]() |
May 24 2005, 02:03 AM
Post
#1
|
|
|
Newbie [ Level 2 ] Group: Members Posts: 28 Joined: 17-April 05 Member No.: 4,081 |
simple question:
how to upload files using delphi, using http protokol that will be received by php script ? ex: delphi ---------------> www.giveittome.com/whereisit.php thanks Oncom Beureum This post has been edited by microscopic^earthling: Nov 3 2005, 05:25 PM |
|
|
|
Aug 14 2005, 10:07 AM
Post
#2
|
|
|
Newbie [ Level 2 ] Group: Members Posts: 25 Joined: 7-August 05 Member No.: 7,682 |
I do not know if it it can be useful, but delphi includes some examples in the diretorio demo. I know that it has an example using ftp.
Good luck! |
|
|
|
Nov 3 2005, 05:05 PM
Post
#3
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 9 Joined: 3-November 05 Member No.: 9,422 |
QUOTE(oncombeureum @ May 23 2005, 10:03 PM) simple question: how to upload files using delphi, using http protokol that will be received by php script ? ex: delphi ---------------> www.giveittome.com/whereisit.php thanks Oncom Beureum You can do this using Indy that comes with Delphi. It involves two things. TIdHTTP and TIdMultipartFormDataStream. Add IdMultipartFormData to your uses clause. Drop TIdHTTP (which is in Indy Clients tab of Component Palette ) on to your form. Set whatever properties of TIdHTTP you want. Now if you were wanting the file to be uploaded after a button has been clicked then put this in the event handler you assigned for the buttons OnClick event. CODE procedure TFormClassNameHere.EventHandlerNameHere( Sender : TObject ) var Stream : TIdMultipartFormDataStream; begin Stream := TIdMultipartFormDataStream.Create; try Stream.AddFile( 'form_field_name_here', 'filename_here', 'content-type_here' ); IdHTTP1.Post( 'url_here', Stream ); finally Stream.Free; end; end; That's basically it. If you have any questions then please feel free to ask. I'm quite proficient in Delphi. Regards, Digital Technic. p.s. If you need an example to be attached I could provide that too. |
|
|
|
Dec 15 2006, 08:34 AM
Post
#4
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 1 Joined: 15-December 06 Member No.: 18,352 |
[quote name='Digital Technic' date='Nov 3 2005, 10:35 PM' post='59255']
You can do this using Indy that comes with Delphi. It involves two things. TIdHTTP and TIdMultipartFormDataStream. yeah, but what if im making a ASP.NET app, cant use Indy ,can I ? then how do I select the file to upload since it doesnt provide dialog box compomnents. Thanx, Aryan |
|
|
|
Feb 12 2008, 03:59 AM
Post
#5
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 0 Joined: 1-November 07 Member No.: 25,869 |
example
Uploading File Using Delphi To A Php Upload Script Replying to Digital Technic Can you give me an example with it, -wowok |
|
|
|
![]() ![]() |
Similar Topics
| Topics | Topics | |
|---|---|---|
|
|
|
|
Lo-Fi Version | Time is now: 6th September 2008 - 08:16 PM |