ফাইল শেয়ার করা
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
অ্যাপগুলির প্রায়শই তাদের এক বা একাধিক ফাইল অন্য অ্যাপে অফার করার প্রয়োজন হয়। উদাহরণস্বরূপ, একটি ইমেজ গ্যালারি ইমেজ এডিটরদের কাছে ফাইল অফার করতে চাইতে পারে, অথবা একটি ফাইল ম্যানেজমেন্ট অ্যাপ ব্যবহারকারীদের এক্সটার্নাল স্টোরেজের এলাকার মধ্যে ফাইল কপি এবং পেস্ট করার অনুমতি দিতে পারে। একটি পাঠানো অ্যাপ ফাইল শেয়ার করতে পারে এমন একটি উপায় হল গ্রহীতা অ্যাপের অনুরোধে সাড়া দেওয়া।
সব ক্ষেত্রে, আপনার অ্যাপ থেকে অন্য অ্যাপে একটি ফাইল অফার করার একমাত্র নিরাপদ উপায় হল গ্রহীতা অ্যাপটিকে ফাইলের বিষয়বস্তু URI পাঠানো এবং সেই URI-তে অস্থায়ী অ্যাক্সেসের অনুমতি দেওয়া। অস্থায়ী ইউআরআই অ্যাক্সেসের অনুমতি সহ কন্টেন্ট ইউআরআইগুলি নিরাপদ কারণ তারা শুধুমাত্র সেই অ্যাপের জন্য প্রযোজ্য যা ইউআরআই গ্রহণ করে এবং সেগুলি স্বয়ংক্রিয়ভাবে শেষ হয়ে যায়। Android FileProvider
উপাদানটি একটি ফাইলের সামগ্রী URI তৈরি করার জন্য getUriForFile()
পদ্ধতি প্রদান করে।
আপনি যদি অ্যাপগুলির মধ্যে অল্প পরিমাণে পাঠ্য বা সাংখ্যিক ডেটা ভাগ করতে চান তবে আপনাকে একটি Intent
পাঠাতে হবে যাতে ডেটা রয়েছে৷ কিভাবে একটি Intent
সহ সাধারণ ডেটা পাঠাতে হয় তা শিখতে, সাধারণ ডেটা ভাগ করা প্রশিক্ষণ ক্লাসটি দেখুন।
এই ক্লাসটি ব্যাখ্যা করে কিভাবে আপনার অ্যাপ থেকে অন্য অ্যাপে ফাইলগুলিকে নিরাপদে Android FileProvider
কম্পোনেন্ট দ্বারা জেনারেট করা ইউআরআই ব্যবহার করে এবং অস্থায়ী অনুমতিগুলি ব্যবহার করে যা আপনি কন্টেন্ট URI-এর জন্য গ্রহণকারী অ্যাপকে দেন।
পাঠ
- ফাইল শেয়ারিং সেট আপ করা হচ্ছে
- ফাইল শেয়ার করতে আপনার অ্যাপ কিভাবে সেট আপ করবেন তা জানুন।
- একটি ফাইল শেয়ার করা হচ্ছে
- ফাইলের জন্য একটি বিষয়বস্তু URI তৈরি করে, URI-তে অ্যাক্সেসের অনুমতি প্রদান করে এবং অ্যাপে URI পাঠিয়ে কীভাবে অন্য অ্যাপে একটি ফাইল অফার করতে হয় তা শিখুন।
- একটি শেয়ার করা ফাইল অনুরোধ করা হচ্ছে
- অন্য অ্যাপের দ্বারা ভাগ করা ফাইলের অনুরোধ কীভাবে করবেন তা শিখুন, ফাইলটির জন্য সামগ্রী URI গ্রহণ করুন এবং ফাইলটি খুলতে সামগ্রী URI ব্যবহার করুন৷
- ফাইল তথ্য পুনরুদ্ধার করা হচ্ছে
- MIME প্রকার এবং ফাইলের আকার সহ ফাইল তথ্য পুনরুদ্ধার করতে একটি অ্যাপ কীভাবে একটি
FileProvider
দ্বারা তৈরি করা একটি সামগ্রী URI ব্যবহার করতে পারে তা জানুন৷
অতিরিক্ত সম্পর্কিত তথ্যের জন্য, পড়ুন:
এই পৃষ্ঠার কন্টেন্ট ও কোডের নমুনাগুলি Content License-এ বর্ণিত লাইসেন্সের অধীনস্থ। Java এবং OpenJDK হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-29 UTC-তে শেষবার আপডেট করা হয়েছে।
[[["সহজে বোঝা যায়","easyToUnderstand","thumb-up"],["আমার সমস্যার সমাধান হয়েছে","solvedMyProblem","thumb-up"],["অন্যান্য","otherUp","thumb-up"]],[["এতে আমার প্রয়োজনীয় তথ্য নেই","missingTheInformationINeed","thumb-down"],["খুব জটিল / অনেক ধাপ","tooComplicatedTooManySteps","thumb-down"],["পুরনো","outOfDate","thumb-down"],["অনুবাদ সংক্রান্ত সমস্যা","translationIssue","thumb-down"],["নমুনা / কোড সংক্রান্ত সমস্যা","samplesCodeIssue","thumb-down"],["অন্যান্য","otherDown","thumb-down"]],["2025-07-29 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["# Sharing files\n\nApps often have a need to offer one or more of their files to another app. For example, an image\ngallery may want to offer files to image editors, or a file management app may want to allow\nusers to copy and paste files between areas in external storage. One way a sending app can\nshare a file is to respond to a request from the receiving app.\n\n\nIn all cases, the only secure way to offer a file from your app to another app is to send the\nreceiving app the file's content URI and grant temporary access permissions to that URI.\nContent URIs with temporary URI access permissions are secure because they apply only to the\napp that receives the URI, and they expire automatically. The Android\n[FileProvider](/reference/androidx/core/content/FileProvider) component provides the method\n[getUriForFile()](/reference/androidx/core/content/FileProvider#getUriForFile(android.content.Context, java.lang.String, java.io.File)) for\ngenerating a file's content URI.\n\n\nIf you want to share small amounts of text or numeric data between apps, you should send an\n[Intent](/reference/android/content/Intent) that contains the data. To learn how to send simple data with an\n[Intent](/reference/android/content/Intent), see the training class\n[Sharing simple data](/training/sharing).\n\n\nThis class explains how to securely share files from your app to another app using content URIs\ngenerated by the Android [FileProvider](/reference/androidx/core/content/FileProvider) component and\ntemporary permissions that you grant to the receiving app for the content URI.\n\nLessons\n-------\n\n**[Setting up file sharing](/training/secure-file-sharing/setup-sharing)**\n:\n Learn how to set up your app to share files.\n\n**[Sharing a file](/training/secure-file-sharing/share-file)**\n:\n Learn how to offer a file to another app by generating a content URI for the file,\n granting access permissions to the URI, and sending the URI to the app.\n\n**[Requesting a shared file](/training/secure-file-sharing/request-file)**\n:\n Learn how to request a file shared by another app, receive the content URI for the file,\n and use the content URI to open the file.\n\n\n**[Retrieving file information](/training/secure-file-sharing/retrieve-info)**\n:\n Learn how an app can use a content URI generated by a\n [FileProvider](/reference/androidx/core/content/FileProvider) to retrieve file information including\n MIME type and file size.\n\nFor additional related information, refer to:\n\n- [Storage Options](/guide/topics/data/data-storage)\n- [Saving Files](/training/basics/data-storage/files)\n- [Sharing Simple Data](/training/sharing)"]]