| | 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 |
|
|
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! 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.
[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
example
Uploading File Using Delphi To A Php Upload Script Replying to Digital Technic Can you give me an example with it, -wowok
Recent Queries:-
Keywords : uploading, file, delphi, php, upload, script, delphi, 6, prefered
(2) My old Delphi 4 will not run on an XP system. Does Delphi 6 run in an XP environment and/or will an Low-level / Pascal / Delphi / Keyboard input simulation (3) I'm trying to simulate a key press in an external program (actually a game). Using the (1) I am about to start a project that will require me to write a client program which will access a delphi 5-8 (3) Hi guys, what is the best option for delphi if I want to change languages on fly in my applications? (1) Somebody knows some component delphi that I allow to use skin in my application? If possible that he Delphi 7.0 Personal (11) Hi, I've just purcased Borland Delphi 7.0 Personal, as I've have an idea to an publication (2) Code Insight Code Parameters : Ctrl-Shift-Space Code Completion : Ctrl-Space Code Looking for uploading, file, delphi, php, upload, script, delphi, 6, prefered
|
|
![]() Uploading File Using Delphi To A Php Upload Script - delphi 6 would be prefered |
| ADD REPLY / Got an Opinion! | a humble request :-) | RAPID SEARCH! | Free Hosting | [X] |
|
Express your Opinions, Thoughts or Contribute your information that might help someone here. Ask your Doubts & Queries to get answers.. "Together, We enlight each other!" |
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP. | 500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE |
|