Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here's an example of using Indy to Post a JPEG to a webserver running <a href="http://gallery.menalto.com/" rel="nofollow noreferrer">Gallery</a></p> <p>I've got more examples of this sort of stuff (I use them in a screensaver I wrote in Delphi for the Gallery project available <a href="http://gloss.ildica.com/" rel="nofollow noreferrer">here</a>, or more info on the Gallery website <a href="http://codex.gallery2.org/GLoSS" rel="nofollow noreferrer">here</a>).</p> <p>The important bit I suppose is that the JPEG gets passed in as a stream. </p> <pre><code>procedure AddImage(const AlbumID: Integer; const Image: TStream; const ImageFilename, Caption, Description, Summary: String); var Response: String; HTTPClient: TidHTTP; ImageStream: TIdMultipartFormDataStream; begin HTTPClient := TidHTTP.Create; try ImageStream := TIdMultiPartFormDataStream.Create; try ImageStream.AddFormField('g2_form[cmd]', 'add-item'); ImageStream.AddFormField('g2_form[set_albumId]', Format('%d', [AlbumID])); ImageStream.AddFormField('g2_form[caption]', Caption); ImageStream.AddFormField('g2_form[force_filename]', ImageFilename); ImageStream.AddFormField('g2_form[extrafield.Summary]', Summary); ImageStream.AddFormField('g2_form[extrafield.Description]', Description); ImageStream.AddObject('g2_userfile', 'image/jpeg', Image, ImageFilename); Response := HTTPClient.Post('http://mygallery.com/main.php?g2_controller=remote:GalleryRemote', ImageStream); finally ImageStream.Free; end; finally HTTPClient.Free; end; end; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload