- 280 名前:デフォルトの名無しさん mailto:sage [2006/12/14(木) 10:48:39 ]
- iアプリ側はこうですか?アップロードされたものをファイルに保存するようなphpはどう書けばいいのでしょうか?(ファイル名は$filename=time().'.3gp'; あたりで)
HttpConnection c; InputStream is, in; OutputStream out; byte[] data; int length; in=camera.getInputStream(0); String url=new String( IApplication.getCurrentApp().getSourceURL()+"save.php" ); try{ c=(HttpConnection)Connector.open( url, Connector.READ_WRITE, true ); c.setRequestMethod(HttpConnection.POST); c.setRequestProperty("Content-type", "applicaton/octet-stream"); out=c.openOutputStream(); data=new byte[1024]; length=in.read(data); while( length != -1 ){ out.write(data, 0, length); length=in.read(data); } in.close(); out.close(); c.connect(); data=new byte[1024*150]; is=c.openInputStream(); length=is.read(data); byte[] work=new byte[length]; System.arraycopy(data,0,work,0,length); is.close(); c.close(); }catch(Exception e){//略 }
|

|