dsgwii4867 2016-07-04 10:56
浏览 11

如何在不点击选择文件的情况下以不同的上传形式上传文件名?

I am working on a CRM, on uploading a file in one upload form. Is it possible to get that file name inside choose file in another form without clicking the choose file option?

This is the code for selecting file in one form.

if ($_FILES['product_image']['name']!='') {
    $target = "file_upload_source/"; 
    $target1 =$target . @date(U)."_".( $_FILES['product_image']['name']);
    $product_image=@date(U)."_".( $_FILES['product_image']['name']);

    move_uploaded_file($_FILES['product_image']['tmp_name'], $target1);

    $getlead_id1 = $_GET['leadid'];
    // $appa = explode("_",$getlead_id1);   
    $data = explode("_",$getlead_id1);
    $lead_id545=$data[0];
    $type464 = $data[1];

    $sl= "
        INSERT INTO dizypro_file_order 
        SET lead_id = '$lead_id545',
            description = '$description',
            name = '$product_image',
            type = '$type464', 
            upld_date = now(), 
            maker_date = now(),
            maker_id = '".$_SESSION['ADMIN_GAME_ID']."',
            divn_id = '".$_SESSION['SESS_Division']."',
            comp_id = '".$_SESSION['SESS_COMPANY']."',
            zone_id = '".$_SESSION['SESS_zone']."',
            brnh_id = '".$_SESSION['SESS_Branch']."'
    ";
    mysql_query($sl);
  • 写回答

1条回答 默认 最新

  • donglao4370 2016-07-04 11:10
    关注

    If I understand the question correctly, you want set the contents of a filefield to a predefined filename when you send a form. Every major browser will not let you do that, on security grounds. An unscrupulous site could display a filefield where the user can't see it, select the name of any file on your computer, put trick the user into uploading that file.

    Short summary: Not possible!

    评论

报告相同问题?

悬赏问题

  • ¥15 怎么改成循环输入删除(语言-c语言)
  • ¥15 安卓C读取/dev/fastpipe屏幕像素数据
  • ¥15 pyqt5tools安装失败
  • ¥15 mmdetection
  • ¥15 nginx代理报502的错误
  • ¥100 当AWR1843发送完设置的固定帧后,如何使其再发送第一次的帧
  • ¥15 图示五个参数的模型校正是用什么方法做出来的。如何建立其他模型
  • ¥100 描述一下元器件的基本功能,pcba板的基本原理
  • ¥15 STM32无法向设备写入固件
  • ¥15 使用ESP8266连接阿里云出现问题