Uploading File Using Delphi To A Php Upload Script - delphi 6 would be prefered

free web hosting
Free Web Hosting > Computers & Tech > Programming > Programming General > Delphi & (Object) Pascal

Uploading File Using Delphi To A Php Upload Script - delphi 6 would be prefered

oncombeureum
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

Reply

fabiocardoso
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!

Reply

Digital Technic
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.

 

 

 


Reply

arxaan
[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

Reply

iGuest
example
Uploading File Using Delphi To A Php Upload Script

Replying to Digital Technic



Can you give me an example with it,



-wowok

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Recent Queries:-
  1. delphi ftp upload - 3.90 hr back. (1)
  2. delphi upload file - 12.17 hr back. (1)
  3. upload using delphi - 21.07 hr back. (1)
  4. delphi www upload - 21.78 hr back. (1)
  5. delphi: indy ftp - 23.65 hr back. (1)
  6. idhttp.post delphi idmultipartformdata - 27.01 hr back. (3)
  7. tidmultipartformdatastream delphi - 27.20 hr back. (1)
  8. upload video file using php - 27.91 hr back. (1)
  9. post file delphi - 28.46 hr back. (1)
  10. tidmultipartformdatastream - 3.44 hr back. (2)
  11. tidhttp delphi example - 34.35 hr back. (1)
  12. upload script delphi - 42.55 hr back. (1)
  13. tidhttp sample - 46.85 hr back. (1)
  14. delphi http post upload - 47.17 hr back. (1)
Similar Topics

Keywords : uploading, file, delphi, php, upload, script, delphi, 6, prefered

  1. Hide Delphi's Splash Screen - Delphi 6
    (0)
  2. Delphi 6 And XP
    (2)
    My old Delphi 4 will not run on an XP system. Does Delphi 6 run in an XP environment and/or will an
    application developed in Delphi 6 run in an XP environment?....
  3. Keyboard Simulation
    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
    keybd_event does work for regular Windows programs (like Notepad, for example), but not for the
    game. I suppose this happens because it uses DirectX libraries, and also this simulation provided by
    keybd_event isn't, let's say, low-level enough. Would someone be able to help me on this?
    I'm using currently Delphi (Pascal), but if needed I suppose I can manage to apply some assembly
    code or something. Thanks in advance.....
  4. Can Delphi Be Used For Distributed Appz?
    (1)
    I am about to start a project that will require me to write a client program which will access a
    database (mysql) across the internet. Will Delphi 2006 Professional have the tools I need to do
    this, or will I need to get Enterprise or Architect. Note that we are not planning on using model
    driven architecture in this project, so buying Enterprise or Architect for Bold or ECO isn't
    required. Thanks wojta....
  5. Help: Change Language On Fly With Delphi
    delphi 5-8 (3)
    Hi guys, what is the best option for delphi if I want to change languages on fly in my applications?
    thx Wojta....
  6. Where Can I Find Free Skin Component For Delphi
    (1)
    Somebody knows some component delphi that I allow to use skin in my application? If possible that he
    is free.....
  7. Resources For Beginner Delphi Programmer ?
    Delphi 7.0 Personal (11)
    Hi, I've just purcased Borland Delphi 7.0 Personal, as I've have an idea to an publication
    that I wish to create. But I seemed much more complicated than I was expected. I've been
    working with webdesigning for several years, and also PHP programming, but never worked with any
    core programming applications like this. My question is as follow. Do anyone have any expirence
    about Delphi, and do any knows where to find turtorials or even better samples, as I really like to
    try this out and then further as it looks funny and cool. My application idea is somethi....
  8. List Of Delphi Keyboard Shortcut - Very Useful
    (2)
    Code Insight Code Parameters : Ctrl-Shift-Space Code Completion : Ctrl-Space Code
    Templates : Ctrl-J Class Completion Class Completion : Ctrl-Shift-C Class Nav
    Up Ctrl-Shift-Up Class Nav Down Ctrl-Shift-Down Code Browsing (D6 and above) Symbol Browsing :
    Alt-Up Browse Forward : Alt-Right Browse Backward : Alt-Left Message Window Previous
    Message : Alt-F7 Next Message : Alt-F8 IDE Windows Code Explorer : Ctrl-Shift-E Project
    Manager : Ctrl-Alt-F11 Window List : Alt-0 (zero) Object Inspector : F11 Debugger Windows
    Event Log :....

    1. Looking for uploading, file, delphi, php, upload, script, delphi, 6, prefered

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for uploading, file, delphi, php, upload, script, delphi, 6, prefered
advertisement




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