iモード携帯電話用Jav ..
[2ch|▼Menu]
280:デフォルトの名無しさん
06/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){//略
}


次ページ
続きを表示
1を表示
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

4659日前に更新/108 KB
担当:undef