Подскажыте как сделать чтоб содержимое файла txt отправлялось по HTTP POST

Discussion in 'С/С++, C#, Rust, Swift, Go, Java, Perl, Ruby' started by smail2133, 22 Apr 2010.

  1. smail2133

    smail2133 New Member

    Joined:
    25 Jan 2010
    Messages:
    10
    Likes Received:
    0
    Reputations:
    0
    Привет Всем !! У меня проблема с отправкой HTTP POST.
    Как сделать чтоб содержымое файла txt отправлялось на сервак при помощи idhttp ???
    Подскажите плис очень надо вот моя ася 477080587
     
  2. Скотти

    Скотти Member

    Joined:
    17 Sep 2009
    Messages:
    23
    Likes Received:
    8
    Reputations:
    0
    http://tinyurl.com/yafr4jf
     
  3. POS_troi

    POS_troi Elder - Старейшина

    Joined:
    1 Dec 2006
    Messages:
    1,569
    Likes Received:
    466
    Reputations:
    108
    Читаеш файл в буфер и отправляешь буфер куда нужно
     
  4. smail2133

    smail2133 New Member

    Joined:
    25 Jan 2010
    Messages:
    10
    Likes Received:
    0
    Reputations:
    0
    Можно кодом ?
     
  5. imreadyourmind

    imreadyourmind New Member

    Joined:
    23 Feb 2010
    Messages:
    38
    Likes Received:
    4
    Reputations:
    5
    вот тебе код отправки первой строчки файла

    Code:
    var  rev,str:string;
      ss: TStringStream;
      s :ANSIstring;
      f:textfile; 
      begin
      
      assignfile(f,getcurrentdir+'/txtfile.txt);
      reset(f);
      readln(f,str);
      closefile(f);
    
      ss := TStringStream.Create('');
      s  :=str;
      ss.WriteString('txt='+s);
    
       http1:=TIdHTTP.Create(nil);
      rev:=http1.Post('http://vkontakte.ru/wall.php', ss);
      http1.Free;
     
  6. 1n0y

    1n0y Active Member

    Joined:
    9 May 2009
    Messages:
    276
    Likes Received:
    282
    Reputations:
    2
    Code:
    var
    file:tstringlist;
    begin
    blabla
    file:=tstringlist.create;
    file.loadfromfile(123.txt);
    http1.Post('http://vkontakte.ru/wall.php', file);
    както так :)
     
  7. Meecript_

    Meecript_ Banned

    Joined:
    29 Oct 2008
    Messages:
    194
    Likes Received:
    62
    Reputations:
    32
    Так точно не получится
     
  8. noxjoker

    noxjoker Member

    Joined:
    7 Aug 2009
    Messages:
    189
    Likes Received:
    24
    Reputations:
    0
    Очень логично в буфер.
     
  9. Meecript_

    Meecript_ Banned

    Joined:
    29 Oct 2008
    Messages:
    194
    Likes Received:
    62
    Reputations:
    32
    PHP:
    TIdMultiPartFormDataStream *multi = new TIdMultiPartFormDataStream;
    TIdHTTP *http = new TIdHTTP(NULL);
    multi->AddFile("file"filename"text/html");
    http->Post(sitemulti);
     
  10. imreadyourmind

    imreadyourmind New Member

    Joined:
    23 Feb 2010
    Messages:
    38
    Likes Received:
    4
    Reputations:
    5
    Ему походу уже ниче не надо))
     
  11. smail2133

    smail2133 New Member

    Joined:
    25 Jan 2010
    Messages:
    10
    Likes Received:
    0
    Reputations:
    0
    Все сделал !! Очень спасибо Кто помог