Author Topic: Upload tool in development whos advanced with indy and have a bit of pascal?  (Read 8865 times)

0 Members and 1 Guest are viewing this topic.

Offline x23piracy

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
    • FHG
Hi,

GERMAN:

gestern habe ich angefangen ein Upload Tool für die Galerie zu programmieren.
Ich bin aber noch weit davon entfernt das Teil zur Verfügung zu stellen.

Noch jede Menge Möglichkeiten exeptions auszulösen ich muss jede Menge
Fehlerbehandlungen einbauen außerdem werde ich mit Schnick Schnack
(n1ce to have) Funktionen wieder Größenwahnsinnig.

Ein großes Problem ist aktuell noch der korrekte Post der Bilddatei ich lese
das wie vorgeschrieben in einen Stream und übermittle es als Object wie das
Script es verlang als MultiPartFormDataStream aber erhalte bloß die Meldung
das ich kein Bilddatei ausgewählt habe da geht also was schief.

Wie kann ich mir das am Server genau angucken was da nicht stimmt?

Der Upload von Bilder mit Remote source funktioniert bereits.

Ein Multiupload ist noch nicht implementiert da ich noch am testen bin, das
sollte aber kein Hinderniss darstellen.

Ist jemand hier der sich mit den Indy Komponenten im besonderen der idhttp gut
auskennt wenn Möglich auch noch Delphi (Pascal) spricht und sich mit http post auskennt?  :mrgreen:

ENGLISH:

yesterday i started the development of an upload tool for 4images.
First of all it will not be released in the next days, not on x-mas and not as new year goodie.

I need much more time for kicking bug fixes out and implement some usefull things.

But i have one big problem, the php script doesn't accept my media_file form data.
It's presented in a stream and send (post) as MultiPartFormDataStream (size is ok) but the
script tells me that i haven't attached a file.

Is someone here advanced with indy and maybe some delphi (pascal) overall http post knowledge?

Uploading (if i can name it like this) of remote image works well at this moment the only big prob
is to transmit the file(s) in the right way... assist needed.

Screenshot:


Due to testing there is no multiupload feature implemented but should be no big thing.

Hier mal der Sourcecode der den Upload erledigt / Sourcepart that's doing the upload:

Quote
procedure TForm1.button_uploadClick(Sender: TObject);
var
  sList: TIdMultipartFormDataStream;
  stream: TStream;
  image1: TImage;
begin
     sList := TIdMultiPartFormDataStream.Create;
     stream := TMemoryStream.Create;
     image1 := TImage.Create(Form1);
     image1.Picture.LoadFromFile('C:\formpost2\test.jpg'); //Hardcoded for testing
     stream.WriteComponent(image1);
     //ShowMessage(IntToStr(stream.Size)); //To check if there is data
  try
    sList.AddFormfield('__csrf', csrf);
    sList.AddFormfield('action', 'uploadimage');
    sList.AddFormfield('cat_id', '24');
    //sList.AddObject ('media_file', 'image/jpeg', image1, 'C:\formpost2\test.jpg'); //Hardcoded for testing, disabled due to problem
    sList.AddFormfield('remote_media_file', remote_media_file.Text);
    sList.AddFormfield('image_name', image_name.Text);
    sList.AddFormfield('image_description', image_description.Text);
    sList.AddFormfield('image_keywords', image_keywords.Text);
    //sList.AddFormfield('captcha', '');
    Listbox1.Items.Clear;
    Listbox1.Items.Text:= idHttp3.post ( galery_url.text + '/member.php', sList);
  finally
    sList.Free;
  end;
end;


Greetz X23
« Last Edit: December 14, 2010, 06:05:47 PM by x23piracy »

Don't trust in md5 it's unsafe change your 4i galerys password hash algorythm! second pw db field, create new hashes over some time, deny old hash. Help members that cry, send informationen mail to the rest. Camouflage new pw hash in cookie. Done!

--(◔̯◔)--

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.805
  • I ♥ 4I
    • View Profile
HAMMER!
Genau das wird auf jeden Fall noch gebraucht!!!!
Respekt!

Offline x23piracy

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
    • FHG
Hi,

die Uploadprobleme mit Dateien sind behoben, ich kann das Tool in den nächsten Tagen/Wochen
fertigstellen, ich füge gerade die Batchupload Möglichkeit hinzu.

Ein weiteres Ziel wäre eine Drop Down Funktion um Bilder beim ziehen auf ein Systray Symbol direkt
hochzuladen, ggf. könnten das sogar Screenshots des Rechners alle X minuten sein.

Da wäre dann noch die Idee den MOD für Thumbnailerstellung von remote media url sourcen überflüssig
zu machen, da mein Tool aktuell remote images herunterlädt, ich müsste nur an die Thumbnail bedingungen
der Galerie kommen um die passende Größe zu liefern. (Ggf. auch aus dem html Quelltext holen).

Die Kategorien parse ich aktuell direkt aus dem html quelltext in eine combobox, leider ist das
Fehleranfällig wenn ich nicht alle möglichen Unterschiede abfange.

Kennt jemand eine Möglichkeit die Kategorien auch als User auslesen zu können ohne den html
Quelltext benutzen zu müssen?

Direkter Datenbankzugriff ist als User undenkbar, gäbe es eine Möglichkeit über eine extra php Datei
die einfach nur folgendes ausgibt?:

Code: [Select]
cat_id, cat_name
1,bla
2,blub


Gruß Jens
« Last Edit: December 17, 2010, 12:22:34 AM by x23piracy »

Don't trust in md5 it's unsafe change your 4i galerys password hash algorythm! second pw db field, create new hashes over some time, deny old hash. Help members that cry, send informationen mail to the rest. Camouflage new pw hash in cookie. Done!

--(◔̯◔)--

Offline x23piracy

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
    • FHG
Hi,

wenn hier noch interesse besteht würde ich meine Sourcecode zur Verfügung stellen (Delphi7 oder größer).
Das Projekt ist zu 85% beendet, ich habe es aber nie ganz abgeschlossen da ich das interesse an 4images verloren habe.


Gruß X23

Don't trust in md5 it's unsafe change your 4i galerys password hash algorythm! second pw db field, create new hashes over some time, deny old hash. Help members that cry, send informationen mail to the rest. Camouflage new pw hash in cookie. Done!

--(◔̯◔)--