uploadify - 重命名上传的文件 [英] uploadify - rename uploaded file

查看:22
本文介绍了uploadify - 重命名上传的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我在看uploadify.php 并没有理解一件事.

Hy , i was looking at uploadify.php and did'n understand a thing.

我有一个这样的表格:

<form id="formid" name="upload_pic" action="upload.php">
<select name="product_id">
<option value="1">Apples</option>
<option value="2">Oranges</option>
... etc
</select>
<input id="file_upload" name="file_upload" />
</form>

我的uploadify设置是:

and my uploadify settings are :

<script type="text/javascript">
$(document).ready(function() {
  $('#file_upload').uploadify({
    'uploader'  : 'uploadify/uploadify.swf',
    'script'    : 'uploadify/uploadify.php',
    'cancelImg' : 'uploadify/cancel.png',
    'folder'    : '../images/level3/tabv_all/tab_header/',
    'auto'      : false,
    'multi'     : true,
    'fileExt'     : '*.jpg',
    'fileDesc'    : 'ONLY JPG (.JPG)',
    'removeCompleted' : false
  });
});
</script>

我想要做的是,如果用户选择具有 id=1Apples 浏览像 Tasty_apples.jpg 之类的文件 -> 上传的文件要重命名为 product@1@Tasty_apples.jpg 然后像这样插入到 mysql 中?

What i want to do is that if the user select Apples wich has the id=1 and browse for a file like Tasty_apples.jpg -> the uploaded file to be renames to product@1@Tasty_apples.jpg and then to be inserted in mysql like that?

主要问题是如何基于

发送“验证码”获取 | 15天全站免登陆