2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

RingoJS v0.8でのファイルアップロード

Posted at

RingoJSのv0.8でそれまでとAPIが変わった模様

そんなわけで、Stackoverflowとかにもサンプルないので、自力で解決した
際の備忘録

fileupload.js
var httpUtils = require('ringo/utils/http');

if(httpUtils.isFileUpload(req.headers["content-type"])) {		
        var params = {};
        httpUtils.parseFileUpload(req,params);       
}

アップロード用のHTML(念のため)

fileup.html
<form action="http://ファイルアップロードのサーバURL"
         enctype="multipart/form-data"
         method="post"> 
<input type="file" name="pics">
             <input type="submit" value="アップロード">
</form>

これでparams['pics'].valueにアップロードしたファイルの
内容が入力される。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?