avatar
Postdoc opportunity at UIUC# ChemEng - 化学工程
h*i
1
说明跟你说话的人对你有怨气
而且两个人的气运匹配,你是受者一方
avatar
b*i
2
我说的stream,就是把链接放入浏览器,就立即开始播放,一边播放,一边下载。
如果我用godaddy的服务器,放入一个静态文件,是可以这样的。
下面是我放入google app engine的servlet, 和一般servlet略为不同就是input/
outputstream有些不同,但原则都一样,结果是浏览器等待文件下载完毕后才打开,请
问为什么?如何改进?谢谢
public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException ,IOException {
res.setContentType("audio/mpeg3");
OutputStream os = res.getOutputStream();
res.setHeader("Content-Disposition", "attachment; filename="" + "a.mp3
";");
res.setContentLength(1000000);
FileService fileService = FileServiceFactory.getFileService();
boolean lockForRead = false;
String filename = "/gs/" + BUCKETNAME + "/" + FILENAME;
AppEngineFile readableFile = new AppEngineFile(filename);

try{
FileReadChannel readChannel = fileService.openReadChannel(readableFile
, lockForRead);
InputStream is = Channels.newInputStream(readChannel);
int BUFF_SIZE = 1024;
byte[] buffer = new byte[BUFF_SIZE];
try {
do {
int byteCount = is.read(buffer);
if (byteCount == -1)
break;
os.write(buffer, 0, byteCount);
os.flush();
} while (true);
} catch (Exception excp) {
} finally {
os.close();
is.close();
}
readChannel.close();
} catch(Exception e){
}
}
avatar
r*t
3
My friend is looking for a Postdoc. He is a very nice guy. this is a good
opportunity.
The Illinois Sustainable Technology Center at University of Illinois Urbana-
Champaign is seeking one full time postdoctoral research associate to
conduct laboratory research, model simulation, and field studies concerning
the enviromental fate and transport of steroid hormones and verterinary
antibiotics derived from animal farms.
Responsibilities: The post-doctoral researcher will work with a team of
scientists to determine hormones and antibiotics in a variety of complex
matrices, investigate the fate and transport of manure-associated steroid
hormones and veterinary antibiotics derived from dairy and beef farms,
develop/utilize models to demonstrate the transport processes of these
contaminants in the environment, and monitor the occurrence of steroid
hormones and veterinary antibiotics in water bodies surrounding dairy and
beef farms. He/she will be actively engaged in most aspects of the research
and will coordinate daily research activities, data management, and multi-
criteria systems analysis, in conjunction with the project management team.
Qualifications: Applicants must have a Ph.D. in chemistry, environmental
engineering, chemical engineering, soil, hydrology or related fields.
Experience with LC-MS analysis and column experiments and model simulation
is preferred.
The position is funded through a USDA/CSREES’s grant with a salary of >$43,
000 plus benefits. Applicants should send a letter of application, C.V., and
the contact information of three professional references (including names,
addresses, phone numbers and e-mail addresses) to Dr. Wei Zheng, llinois
Sustainable Technology Center, 1 E. Hazelwood Drive, Champaign, IL 61820, or
e-mail to w****[email protected] Applicants materials will be accepted
immediately and until the position is filled.
avatar
S*w
4
猪撞树上了
avatar
b*i
5
补充一点,正确的response是
HTTP/1.1 200 OK
Date: Mon, 27 Feb 2012 04:25:54 GMT
Server: Apache
Last-Modified: Sun, 27 Nov 2011 05:05:40 GMT
ETag: "1530c7-1a1ac3-442b0566f0745"
Accept-Ranges: bytes
Content-Length: 1055427
Cache-Control: max-age=1209600
Expires: Mon, 12 Mar 2012 04:25:54 GMT
Content-Type: audio/mpeg
我是否要加上 setHeader来设定这些?到底是什么使得原来的goDaddy上面的http://xxx.com/a.mp3可以立即播放,而我的通过servlet的要下载后?我把 res.setHeader("Content-Disposition", "attachment; filename="" + "a.mp3
删掉也不行。

mp3

【在 b***i 的大作中提到】
: 我说的stream,就是把链接放入浏览器,就立即开始播放,一边播放,一边下载。
: 如果我用godaddy的服务器,放入一个静态文件,是可以这样的。
: 下面是我放入google app engine的servlet, 和一般servlet略为不同就是input/
: outputstream有些不同,但原则都一样,结果是浏览器等待文件下载完毕后才打开,请
: 问为什么?如何改进?谢谢
: public void doGet(HttpServletRequest req, HttpServletResponse res) throws
: ServletException ,IOException {
: res.setContentType("audio/mpeg3");
: OutputStream os = res.getOutputStream();
: res.setHeader("Content-Disposition", "attachment; filename="" + "a.mp3

avatar
t*y
6
好诗

【在 S*******w 的大作中提到】
: 猪撞树上了
avatar
b*i
7
我说的stream,就是把链接放入浏览器,就立即开始播放,一边播放,一边下载。
如果我用godaddy的服务器,放入一个静态文件,是可以这样的。
下面是我放入google app engine的servlet, 和一般servlet略为不同就是input/
outputstream有些不同,但原则都一样,结果是浏览器等待文件下载完毕后才打开,请
问为什么?如何改进?谢谢
public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException ,IOException {
res.setContentType("audio/mpeg3");
OutputStream os = res.getOutputStream();
res.setHeader("Content-Disposition", "attachment; filename="" + "a.mp3
";");
res.setContentLength(1000000);
FileService fileService = FileServiceFactory.getFileService();
boolean lockForRead = false;
String filename = "/gs/" + BUCKETNAME + "/" + FILENAME;
AppEngineFile readableFile = new AppEngineFile(filename);

try{
FileReadChannel readChannel = fileService.openReadChannel(readableFile
, lockForRead);
InputStream is = Channels.newInputStream(readChannel);
int BUFF_SIZE = 1024;
byte[] buffer = new byte[BUFF_SIZE];
try {
do {
int byteCount = is.read(buffer);
if (byteCount == -1)
break;
os.write(buffer, 0, byteCount);
os.flush();
} while (true);
} catch (Exception excp) {
} finally {
os.close();
is.close();
}
readChannel.close();
} catch(Exception e){
}
}
avatar
b*i
8
补充一点,正确的response是
HTTP/1.1 200 OK
Date: Mon, 27 Feb 2012 04:25:54 GMT
Server: Apache
Last-Modified: Sun, 27 Nov 2011 05:05:40 GMT
ETag: "1530c7-1a1ac3-442b0566f0745"
Accept-Ranges: bytes
Content-Length: 1055427
Cache-Control: max-age=1209600
Expires: Mon, 12 Mar 2012 04:25:54 GMT
Content-Type: audio/mpeg
我是否要加上 setHeader来设定这些?到底是什么使得原来的goDaddy上面的http://xxx.com/a.mp3可以立即播放,而我的通过servlet的要下载后?我把 res.setHeader("Content-Disposition", "attachment; filename="" + "a.mp3
删掉也不行。

mp3

【在 b***i 的大作中提到】
: 我说的stream,就是把链接放入浏览器,就立即开始播放,一边播放,一边下载。
: 如果我用godaddy的服务器,放入一个静态文件,是可以这样的。
: 下面是我放入google app engine的servlet, 和一般servlet略为不同就是input/
: outputstream有些不同,但原则都一样,结果是浏览器等待文件下载完毕后才打开,请
: 问为什么?如何改进?谢谢
: public void doGet(HttpServletRequest req, HttpServletResponse res) throws
: ServletException ,IOException {
: res.setContentType("audio/mpeg3");
: OutputStream os = res.getOutputStream();
: res.setHeader("Content-Disposition", "attachment; filename="" + "a.mp3

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。