[File Plugin] tutorial how to get create and delete in internal and external storage
Question
Forge component by OutSystems R&D

hi,,, im deddy and i really new using outsystems for mobile development tools, i want to create or delete file in internal or external android storage. could give me an simple tutorial how to do that ?

thnks

mvp_badge
MVP

HI Deddy,


Its very simple as extension given method to do it please see below.

1.Create Directory
2.Create File
3.Delete File 




i want to ask create directory first  

1. what action do you use on  RequestDirectoryFromFileSystem   ?

2.  can you show me detail of createDirectories action especially in path and storagetypeId column ? 

3. what which storage do you create, is external or internal storage ?

 i still confuse on createDirectory what path i should use if i want to create it in external / internal. thanks

 


mvp_badge
MVP

deddy effendi wrote:

i want to ask create directory first  

1. what action do you use on  RequestDirectoryFromFileSystem   ?

2.  can you show me detail of createDirectories action especially in path and storagetypeId column ? 

3. what which storage do you create, is external or internal storage ?

 i still confuse on createDirectory what path i should use if i want to create it in external / internal. thanks

 



Name:-Directory name to be created, e.g Docs
Path:-Path where the Directory will be created, e.g Files/Recent
StorageType:-Identifies the Storage type, Internal or External (this is only for Android)-from StorageType static entity (Internal Or External)




Salman Ansari wrote:

deddy effendi wrote:

i want to ask create directory first  

1. what action do you use on  RequestDirectoryFromFileSystem   ?

2.  can you show me detail of createDirectories action especially in path and storagetypeId column ? 

3. what which storage do you create, is external or internal storage ?

 i still confuse on createDirectory what path i should use if i want to create it in external / internal. thanks

 



Name:-Directory name to be created, e.g Docs
Path:-Path where the Directory will be created, e.g Files/Recent
StorageType:-Identifies the Storage type, Internal or External (this is only for Android)-from StorageType static entity (Internal Or External)




i try to create directory in android device, i put path =  "file:///storage/emulated/0/Android/data/" and Name = "aaa",StorageType= Entities.StorageType.External. i run it on my android device but i got error cannot read property 'getDirectory' of null

how do i fix it ? 


is create directory same as create folder on my android device ?

mvp_badge
MVP

deddy effendi wrote:

Salman Ansari wrote:

deddy effendi wrote:

i want to ask create directory first  

1. what action do you use on  RequestDirectoryFromFileSystem   ?

2.  can you show me detail of createDirectories action especially in path and storagetypeId column ? 

3. what which storage do you create, is external or internal storage ?

 i still confuse on createDirectory what path i should use if i want to create it in external / internal. thanks

 



Name:-Directory name to be created, e.g Docs
Path:-Path where the Directory will be created, e.g Files/Recent
StorageType:-Identifies the Storage type, Internal or External (this is only for Android)-from StorageType static entity (Internal Or External)




i try to create directory in android device, i put path =  "file:///storage/emulated/0/Android/data/" and Name = "aaa",StorageType= Entities.StorageType.External. i run it on my android device but i got error cannot read property 'getDirectory' of null

how do i fix it ? 


Try this like this "Files/Recent"

mvp_badge
MVP

I tried on Android using OutSystems Now



Salman Ansari wrote:

I tried on Android using OutSystems Now



what should i add on message to check whether is folder is created or or not ?


mvp_badge
MVP

deddy effendi wrote:

Salman Ansari wrote:

I tried on Android using OutSystems Now



what should i add on message to check whether is folder is created or or not ?


you can check if any ErrorCode is there along with Error Message


how i can get the detail of this path in my message ?

mvp_badge
MVP

deddy effendi wrote:

how i can get the detail of this path in my message ?


in my mobile android apps message was display folder path 


but when i check in my android device, there is no folder such Download > eRecruitment 


my create directory :


how do i know where exactly the folder has created ?

mvp_badge
MVP

deddy effendi wrote:

in my mobile android apps message was display folder path 


but when i check in my android device, there is no folder such Download > eRecruitment 


my create directory :


how do i know where exactly the folder has created ?


Can you try to write some file in that folder and then search the file from Search option in "Files" Android

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.