简体   繁体   English

如何使用 javascript 上传多个文件?

[英]How to upload multiple files using javascript?

I have 5 upload files here,我这里有5个上传文件, 在此处输入图像描述 , now I am trying to figure out how to send it to the db after I convert it to base64, the problem is I don't know how to attach it to attachment_id . ,现在我想弄清楚在将其转换为 base64 后如何将其发送到数据库,问题是我不知道如何将其附加到attachment_id 在此处输入图像描述

actually i dont really know the exact question, but hope this would help实际上我真的不知道确切的问题,但希望这会有所帮助

if you want to send files to your own db you can use formData , it helps you to send it to server如果您想将文件发送到您自己的数据库,您可以使用formData ,它可以帮助您将其发送到服务器

about the attachment_id , i think you can use random string or simple counter to make your file has unique关于attachment_id ,我认为您可以使用随机字符串或简单的计数器来使您的文件具有唯一性

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM