0

    从HTML表单上传3张图片。 通过Javascript发送图像到PHP上传

    2023.05.27 | admin | 132次围观

    问题描述

    Kindly have a look at the screenshot that follows the description and question.

    请查看描述和问题后面的屏幕截图

    As you can see there are 3 files that i need to upload from different blocks.

    如您所见,我需要从不同的块上传3个文件。 These blocks are generated dynamically according to the number of datas in the database.

    这些块是根据数据库中的数据量动态生成的。 When i have 1 file to be uploaded this works completely fine, ie, the image preview function (onChange it shows the preview of the image to be uploaded) and it is saved to the corresponding folder and subfolder created on run time.

    当我有1个要上传的文件时,这完全正常,即图像预览功能(onChange它显示要上传的图像的预览) ,并保存到运行时创建的相应文件夹和子文件夹。

    Now when I am trying to add more file uploads neither does the image preview function work nor does the image is saved to folders or subfolders.

    现在js上传图片到项目服务器上,当我尝试添加更多文件上传时,图像预览功能既不起作用也不将图像保存到文件夹或子文件夹。 Please find below the code for the following, please take note of the comments as well for better understanding.

    从HTML表单上传3张图片。  通过Javascript发送图像到PHP上传

    请在下面找到以下代码,请注意评论以便更好地理解。

    The code is the part of the a PHP where I have added an HTML as well.

    代码是PHP的一部分js上传图片到项目服务器上,我也添加了一个HTML。 HTML form for the images alongwith the javascript for the features.

    用于图像的HTML表单以及用于功能的javascript。

    if($x==1){ ?>
            
    " alt="your image" />



    Here is the PHP that is called by the Javascript for the images to be uploaded.

    这是由Javascript调用的PHP,用于上传图像。

    
    

    Kindly let me know how to accomplish this thing.

    请让我知道如何完成这件事。

    版权声明

    本文仅代表作者观点。
    本文系作者授权发表,未经许可,不得转载。

    发表评论