简体   繁体   English

使用 html 中的图像托管服务中的图像上传个人资料图片的图像

[英]Uploading images for profile picture using images from image hosting service in html

How to allow a user to upload an avatar image for their profile picture from the local machine or a URL to an image hosting service such as Imgur in HTML.如何允许用户从本地计算机或 URL 将其个人资料图片的头像图像上传到图像托管服务,例如 HTML 中的 Imgur。 Uploading an image from a local machine is fine.从本地机器上传图像很好。 But my problem is how to allow user upload an image form an image hosting service?但我的问题是如何允许用户从图像托管服务上传图像?

You can use a service like https://imgbb.com/ and then you can use the URL of the uploaded picture in your JavaScript.您可以使用https://imgbb.com/ 之类的服务,然后您可以在 JavaScript 中使用上传图片的 URL。 They provide an API interface to ease such operation.他们提供了一个 API 接口来简化此类操作。

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

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