* [Comm] file uploading via http @ 2005-04-27 6:29 Denis G. Samsonenko 2005-04-27 5:41 ` Stanislav Yadykin 0 siblings, 1 reply; 10+ messages in thread From: Denis G. Samsonenko @ 2005-04-27 6:29 UTC (permalink / raw) To: community День добрый! Не подскажет ли кто, как делается upload файлов через http. Как сделать форму с кнопкой я нашёл, а вот как это должно обрабатываться cgi-скриптом -- нет. Мне надо сделать, чтобы можно было закачивать на сайт файлы через html-форму. Обрабатывающий cgi-скрипт хочу писать на bash. -- Всего доброго, Денис. --------------- earthsea@ngs.ru ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Comm] file uploading via http 2005-04-27 6:29 [Comm] file uploading via http Denis G. Samsonenko @ 2005-04-27 5:41 ` Stanislav Yadykin 2005-04-27 5:44 ` Aleksander N. Gorohovski 2005-04-27 7:47 ` Denis G. Samsonenko 0 siblings, 2 replies; 10+ messages in thread From: Stanislav Yadykin @ 2005-04-27 5:41 UTC (permalink / raw) To: community [-- Attachment #1: Type: text/plain, Size: 505 bytes --] В сообщении от Среда, 27-Апр-2005 09:29 Denis G. Samsonenko написал(a): > День добрый! > > Не подскажет ли кто, как делается upload файлов через http. Как сделать > форму с кнопкой я нашёл, а вот как это должно обрабатываться > cgi-скриптом -- нет. > > Мне надо сделать, чтобы можно было закачивать на сайт файлы через > html-форму. Обрабатывающий cgi-скрипт хочу писать на bash. На баше - сомневаюсь в целесообразности. На преле - perldoc CGI в раздел file uploads -- Stanislav Yadykin ALT Linux Team [-- Attachment #2: Type: application/pgp-signature, Size: 190 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Comm] file uploading via http 2005-04-27 5:41 ` Stanislav Yadykin @ 2005-04-27 5:44 ` Aleksander N. Gorohovski 2005-04-27 7:47 ` Denis G. Samsonenko 1 sibling, 0 replies; 10+ messages in thread From: Aleksander N. Gorohovski @ 2005-04-27 5:44 UTC (permalink / raw) To: community On Wed, 27 Apr 2005 08:41:21 +0300, Stanislav Yadykin <tosick@altlinux.ru> wrote: > В сообщении от Среда, 27-Апр-2005 09:29 Denis G. Samsonenko написал(a): >> День добрый! >> >> Не подскажет ли кто, как делается upload файлов через http. Как сделать >> форму с кнопкой я нашёл, а вот как это должно обрабатываться >> cgi-скриптом -- нет. >> >> Мне надо сделать, чтобы можно было закачивать на сайт файлы через >> html-форму. Обрабатывающий cgi-скрипт хочу писать на bash. > > На баше - сомневаюсь в целесообразности. Присоединяюсь к этому мнению. Большой геморой. :-) > На преле - perldoc CGI в раздел file uploads А на perl это будет рулить за милую душу. Могу подарить нужный Вам фрагмент из собственных сочинений: :-) ----------------------------------------------------------------- use CGI qw(:standard :netscape); print start_html(-title=>"Download File", -author=>'angel@feht.dgtu.donetsk.ua', -meta=>{'copyright'=>'copyright 2002-2005 Aleksander N.Gorohovski'}, -encoding=>'koi8-r', -BGCOLOR=>'white'); if ($Step eq 'One') { print start_multipart_form(), i('Укажите место хранения (путь) и имя своего файла (*.csv) с выполненной работой:<BR><BR>'), center( filefield(-name=>'filename', -default=>'example.csv', -size=>60, -maxlength=>80), p,$hid,reset('reset','Очистить поля'),' ', submit('submit','Переслать и проверить файл'),hr(),endform); } # Обработка результатов if (my $file = param('filename')) { print center(h3("Итоги предварительного анализа полученной информации")), i("От Вас получен файл данных: "),b($file),br; my $MyFile="MyFile"; open(DEST,">$MyFile") || print "Er:file<BR>"; while (<$file>) { print DEST; } close(DEST); close $file; } ---------------------------------------------------------- ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Comm] file uploading via http 2005-04-27 5:41 ` Stanislav Yadykin 2005-04-27 5:44 ` Aleksander N. Gorohovski @ 2005-04-27 7:47 ` Denis G. Samsonenko 2005-04-27 5:57 ` Aleksander N. Gorohovski ` (2 more replies) 1 sibling, 3 replies; 10+ messages in thread From: Denis G. Samsonenko @ 2005-04-27 7:47 UTC (permalink / raw) To: community Hi! Stanislav Yadykin пишет: >> Мне надо сделать, чтобы можно было закачивать на сайт файлы через >> html-форму. Обрабатывающий cgi-скрипт хочу писать на bash. > > На баше - сомневаюсь в целесообразности. > На преле - perldoc CGI в раздел file uploads Мне на баше проще. Я не знаю перла и в ближайшее время вряд ли узнаю. Но это не суть важно. Просто я не нашёл описания того, как этот файл(ы) передаётся(ются) cgi-скрипту. Соответственно не знаю, как это обрабатывать. -- Всего доброго, Денис. --------------- earthsea@ngs.ru ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Comm] file uploading via http 2005-04-27 7:47 ` Denis G. Samsonenko @ 2005-04-27 5:57 ` Aleksander N. Gorohovski 2005-04-27 6:58 ` Stanislav Yadykin 2005-04-27 7:29 ` [Comm] " Alexey Morsov 2 siblings, 0 replies; 10+ messages in thread From: Aleksander N. Gorohovski @ 2005-04-27 5:57 UTC (permalink / raw) To: community On Wed, 27 Apr 2005 02:47:16 -0500, Denis G. Samsonenko <earthsea@ngs.ru> wrote: > Hi! > > Stanislav Yadykin пишет: >>> Мне надо сделать, чтобы можно было закачивать на сайт файлы через >>> html-форму. Обрабатывающий cgi-скрипт хочу писать на bash. >> На баше - сомневаюсь в целесообразности. >> На преле - perldoc CGI в раздел file uploads > > Мне на баше проще. Я не знаю перла и в ближайшее время вряд ли узнаю. Ну и зря. :-( Более мощный язык (а это действительно настоящий язык, с возможностями создания любых семантических конструкций, а не просто набор логических операторов) трудно найти в этом мире. > Но это не суть важно. Просто я не нашёл описания того, как этот файл(ы) > передаётся(ются) cgi-скрипту. Соответственно не знаю, как это > обрабатывать. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Comm] file uploading via http 2005-04-27 7:47 ` Denis G. Samsonenko 2005-04-27 5:57 ` Aleksander N. Gorohovski @ 2005-04-27 6:58 ` Stanislav Yadykin 2005-04-27 12:13 ` Denis G. Samsonenko 2005-04-27 21:17 ` [Comm] " Arioch 2005-04-27 7:29 ` [Comm] " Alexey Morsov 2 siblings, 2 replies; 10+ messages in thread From: Stanislav Yadykin @ 2005-04-27 6:58 UTC (permalink / raw) To: community [-- Attachment #1: Type: text/plain, Size: 706 bytes --] В сообщении от Среда, 27-Апр-2005 10:47 Denis G. Samsonenko написал(a): > > На баше - сомневаюсь в целесообразности. > > На преле - perldoc CGI в раздел file uploads > > Мне на баше проще. Я не знаю перла и в ближайшее время вряд ли узнаю. Ну-ну. > Но это не суть важно. Просто я не нашёл описания того, как этот файл(ы) > передаётся(ются) cgi-скрипту. Соответственно не знаю, как это обрабатывать. RFC 1867: Form-based File Upload in HTML Прочитать, оценить количество строк кода на баше для _полноценного_ разбора данных полученных на STDIN, сравнить с длиной кода на перле, плюнуть на баш и сделать все на перле, потратив на это 5 минут на чтение документации. -- Stanislav Yadykin ALT Linux Team [-- Attachment #2: Type: application/pgp-signature, Size: 190 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Comm] file uploading via http 2005-04-27 6:58 ` Stanislav Yadykin @ 2005-04-27 12:13 ` Denis G. Samsonenko 2005-04-27 10:48 ` Aleksander N. Gorohovski 2005-04-27 21:17 ` [Comm] " Arioch 1 sibling, 1 reply; 10+ messages in thread From: Denis G. Samsonenko @ 2005-04-27 12:13 UTC (permalink / raw) To: community Hi! Stanislav Yadykin пишет: >> Но это не суть важно. Просто я не нашёл описания того, как этот файл(ы) >> передаётся(ются) cgi-скрипту. Соответственно не знаю, как это обрабатывать. > RFC 1867: Form-based File Upload in HTML > > Прочитать, оценить количество строк кода на баше для _полноценного_ разбора > данных полученных на STDIN, сравнить с длиной кода на перле, плюнуть на баш и > сделать все на перле, потратив на это 5 минут на чтение документации. В общем нашёл я пример готового очень простого perl-скрипта и немного подредактировал его. Вроде работает. Большего и не надо. -- Всего доброго, Денис. --------------- earthsea@ngs.ru ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Comm] file uploading via http 2005-04-27 12:13 ` Denis G. Samsonenko @ 2005-04-27 10:48 ` Aleksander N. Gorohovski 0 siblings, 0 replies; 10+ messages in thread From: Aleksander N. Gorohovski @ 2005-04-27 10:48 UTC (permalink / raw) To: community On Wed, 27 Apr 2005 07:13:37 -0500, Denis G. Samsonenko <earthsea@ngs.ru> wrote: > Hi! > > Stanislav Yadykin пишет: >>> Но это не суть важно. Просто я не нашёл описания того, как этот файл(ы) >>> передаётся(ются) cgi-скрипту. Соответственно не знаю, как это >>> обрабатывать. >> RFC 1867: Form-based File Upload in HTML >> Прочитать, оценить количество строк кода на баше для _полноценного_ >> разбора данных полученных на STDIN, сравнить с длиной кода на перле, >> плюнуть на баш и сделать все на перле, потратив на это 5 минут на >> чтение документации. > > В общем нашёл я пример готового очень простого perl-скрипта и немного > подредактировал его. Вроде работает. Большего и не надо. Спасибо ^ permalink raw reply [flat|nested] 10+ messages in thread
* [Comm] Re: file uploading via http 2005-04-27 6:58 ` Stanislav Yadykin 2005-04-27 12:13 ` Denis G. Samsonenko @ 2005-04-27 21:17 ` Arioch 1 sibling, 0 replies; 10+ messages in thread From: Arioch @ 2005-04-27 21:17 UTC (permalink / raw) To: community Stanislav Yadykin пишет: > RFC 1867: Form-based File Upload in HTML а что у нас сейчас с WebDAV ? ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Comm] file uploading via http 2005-04-27 7:47 ` Denis G. Samsonenko 2005-04-27 5:57 ` Aleksander N. Gorohovski 2005-04-27 6:58 ` Stanislav Yadykin @ 2005-04-27 7:29 ` Alexey Morsov 2 siblings, 0 replies; 10+ messages in thread From: Alexey Morsov @ 2005-04-27 7:29 UTC (permalink / raw) To: community Denis G. Samsonenko wrote: > Но это не суть важно. Просто я не нашёл описания того, как этот файл(ы) > передаётся(ются) cgi-скрипту. Соответственно не знаю, как это обрабатывать. А передаются они как по методу POST, только форма иная ( enctype="multipart/form-data") а данные из форм (в том числе и сам файл) выдаются как обычно в POST на STDIN - можете попробоватьего просто выдать на stdout - увидете что после значений из форм идет содердимое файла (подсунте какой-нить текстовой файлик) Но вот как выцепить этот файл я в свое время на Си не понял :) -- Всего наилучшего, Системный Администратор ЗАО "ИК "РИКОМ-ТРАСТ" Алексей Морсов ICQ: 196766290 Jabber: Samurai@jabber.pibhe.com http://www.ricom.ru http://www.fondmarket.ru ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2005-04-27 21:17 UTC | newest] Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2005-04-27 6:29 [Comm] file uploading via http Denis G. Samsonenko 2005-04-27 5:41 ` Stanislav Yadykin 2005-04-27 5:44 ` Aleksander N. Gorohovski 2005-04-27 7:47 ` Denis G. Samsonenko 2005-04-27 5:57 ` Aleksander N. Gorohovski 2005-04-27 6:58 ` Stanislav Yadykin 2005-04-27 12:13 ` Denis G. Samsonenko 2005-04-27 10:48 ` Aleksander N. Gorohovski 2005-04-27 21:17 ` [Comm] " Arioch 2005-04-27 7:29 ` [Comm] " Alexey Morsov
ALT Linux Community general discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 community community/ http://lore.altlinux.org/community \ mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com public-inbox-index community Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.community AGPL code for this site: git clone https://public-inbox.org/public-inbox.git