Re: [問題] 請問怎麼寫出最精簡的file upload?

看板java作者 (冰色太陽)時間17年前 (2008/11/30 03:49), 編輯推噓2(201)
留言3則, 3人參與, 最新討論串2/3 (看更多)
不好意思 我問的沒有很清楚 我是想實作一個CLASS 可以發送 像下面的資訊給HTTP的網路空間 例子 http://tinyurl.com/637k9q POST register.jsp HTTP/1.1 Host: hi/iq User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2) Gecko/20021126 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1 Accept-Language: en-us, en;q=0.50 Accept-Encoding: gzip, deflate, compress;q=0.9 Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66 Keep-Alive: 300 Connection: keep-alive Content-Type: multipart/form-data; boundary=---------------------------29772313742745 Content-Length: 452 -----------------------------29772313742745 Content-Disposition: form-data; name="name" J.Doe -----------------------------29772313742745 Content-Disposition: form-data; name="email" abuse@spamcop.com -----------------------------29772313742745 Content-Disposition: form-data; name="file-upload"; filename="test.txt" Content-Type: text/plain test data with some high ascii: ¿Como estás? -----------------------------29772313742745-- -- I've become so numb I can't feel you there I've become so tired so much more aware Linkin Park - Numb -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 122.123.133.53

11/30 04:05, , 1F
看來我似乎誤會你的意思了@@
11/30 04:05, 1F

11/30 04:45, , 2F
就用socket傳一段HTTP上傳檔案格式的資料到server就行了
11/30 04:45, 2F

11/30 10:57, , 3F
請問2樓有範例可以參考嗎?
11/30 10:57, 3F
文章代碼(AID): #19CPpNSC (java)
文章代碼(AID): #19CPpNSC (java)