您的位置:首页 > 其它

如何在上传文件的时候,同时把这个文件自动命名

2005-03-27 21:50 525 查看
com.jspsmart.upload.File myFile = mySmartUpload.getFiles().getFile(0);
if (!myFile.isMissing()) {
filename=myFile.getFileName();
String suffix=filename.substring(filename.lastIndexOf('.'));
Date now=new Date();
filename=String.valueOf(now.getTime())+suffix;
url="/download/userdoc/"+filename;
// Save the files with its original names in a virtual path of the web server
myFile.saveAs(url);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐