Google Drive की image को HTML में img
tag और src
attribute के माध्यम से उपयोग करना थोड़ा tricky हो सकता है, क्योंकि Google Drive की direct URLs embed के लिए काम नहीं करतीं। नीचे स्टेप्स दिए गए हैं, जो आपको इसे सही तरीके से उपयोग करने में मदद करेंगे:
सबसे पहले, अपनी image को Google Drive में अपलोड करें।
Image की Shareable Link Generate करें:
Google Drive में image पर right-click करें।
Manage access विकल्प चुनें।
Link को "Anyone with the link" पर सेट करें और Copy करें।
एक popup खुलेगा जिसमें लिखा होगा "Restricted" या "Anyone with the link"।
"Restricted" को बदलकर "Anyone with the link" कर दें।
Permission को "Viewer" पर सेट करें ताकि users image को केवल देख सकें।
"Copy Link" पर क्लिक करें और इसे save कर लें।
Embed Link Generate करें (Optional):
अगर आप image को HTML में img tag के लिए उपयोग करना चाहते हैं, तो इस link को embed format में बदलें:
Example के तौर पर मैं google drive पर पड़ी हुई एक image का example link प्रस्तुत कर रहा हूं।
Example link
https://drive.google.com/file/d/1jwGaO0vphMV4CKVMvcj4O1TU7o1ATvkD/view?usp=drivesdk
Embed Format
https://drive.google.com/uc?export=view&id=1jwGaO0vphMV4CKVMvcj4O1TU7o1ATvkD
Embed format का मतलब
Embed Format का मतलब है किसी external resource (जैसे image, video, audio, या document) को किसी अन्य प्लेटफ़ॉर्म या webpage में शामिल करना, ताकि वह content उसी पेज पर directly दिखाई या चल सके।
यह external content को link करने के बजाय उसे webpage में seamlessly integrate करने का तरीका है।
Complete code:
<!DOCTYPE html>
<html>
<body>
<h1>Google Drive से Image</h1>
<p>नीचे दी गई image Google Drive से embed की गई है:</p>
<img src="https://drive.google.com/uc?export=view&id=1jwGaO0vphMV4CKVMvcj4O1TU7o1ATvkD" alt="Google Drive Image" width="500">
</body>
</html>
कोड को किसी text editor के html सेक्शन में सेव करें।
Browser में फाइल को ओपन करें।
यदि image अभी भी शो नहीं हो रही है, तो निम्न जांचें:
Embed Link को फिर से Validate करें।
Public Link Confirm करें।
अगर सभी settings सही हैं और image नहीं दिख रही है, तो Google Drive की link embedding में समस्या हो सकती है। इस स्थिति में, आप निम्न विकल्प ट्राई करें:
Image को अन्य hosting platform (जैसे Imgur) पर अपलोड करें।
उस hosting platform का direct URL उपयोग करें।
Embed Format का महत्व:
Seamless Integration:
External content को webpage पर directly दिखाने का आसान तरीका।
Dynamic Content:
Videos, audios, documents, और images को dynamically load किया जा सकता है।
User-Friendly Experience:
Users को अलग-अलग platforms पर जाने की ज़रूरत नहीं होती।
Code द्वारा Google Drive की Images कैसे Show करें
Google Drive पर उपलब्ध images को वेबपेज पर दिखाना एक आसान प्रक्रिया है, लेकिन इसमें सही कोड और लिंक फॉर्मेट का उपयोग करना आवश्यक है। सबसे पहले, Google Drive में image की visibility को "Anyone with the link" पर सेट करना होता है ताकि image publically accessible हो। इसके बाद, image के लिंक से उसका File ID निकालकर उसे embed format में बदलें, जैसे:
https://drive.google.com/uc?export=view&id=FILE_ID
इसके बाद, HTML कोड में <img> टैग का उपयोग करके image को वेबपेज पर दिखाया जा सकता है। उदाहरण के लिए:
<img src="https://drive.google.com/uc?export=view&id=FILE_ID" alt="Image Description" width="500">
इस प्रक्रिया के माध्यम से आप Google Drive की images को seamless तरीके से अपने वेबपेज पर embed कर सकते हैं। यह तरीका user-friendly और dynamic web content बनाने के लिए अत्यंत उपयोगी है।
Read Also
HTML Attributes Kya Hai? Beginners ke liye complete guide
HTML Basic Guide for Beginners in Hindi
Best HTML Editors Website बनाने के लिए
HTML Kya Hai ? Main Elements of HTML in Hindi
HTML में Style Attribute का उपयोग कैसे करें
No comments:
Post a Comment
Please अपने नाम से ही comment करें browser में अपनी ID से sign in करें इसके बाद comment करें ।