How to create a folder in the AppDataDirectory for a Dotnet Maui app? - maui

With UWP one would use ApplicationData.Current.LocalFolder.CreateFolderAsync().
I can find no maui equivalent. The objective is to have seperate user folders (ie user1, user2) within the app data directory.

Have you checked the official document about the file system in the maui?
For the windows platform in the maui:
FileSystem.AppDataDirectory
Returns the LocalFolder directory that is backed up to the cloud.
You can try to create the user folder by the following code:
string mainDir =System.IO.Path.Combine(FileSystem.Current.AppDataDirectory, "user1") ;
System.IO.Directory.CreateDirectory(mainDir);

Related

Flutter - Where should I save downloaded files?

I am building a flutter app (iOS/Android/MacOS/Windows/Web) which is able to download files, selected by the user. But where should I save those files? On MacOS/Windows its easy using path_provider and get the path of the downloads folder.
But where should I save the files on the other platforms? The downloads folder would be perfect because the users are able to use those files (.pdf) even without using the app, so the files are not app specific.
If you wish to save in download directory you can use
Directory appDownloadDir = await getDownloadsDirectory();
String appDownloadPath = appDownloadDir.path;
Or
getExternalStorageDirectory()//android
getApplicationDocumentsDirectory()// ios doesnt support access to download folder

How to deploy ABP to IIS

I have a ABP template. It is a merged solution for Angular in Full .Net framework. I have already created a published package by right clicking on the Web.Host project and then Publish.
Here is a screenshot of my published folder:
I have also added a website in my local IIS and have pointed it to the wwwroot folder of my published folder as localhost:8081
I have modified the appconfig.json in the wwwroot/assets folder as:
{
"remoteServiceBaseUrl": "http://localhost:8081",
"appBaseUrl": "http://localhost:8081"
}
and have also changed appsettings.json to
"App": {
"ServerRootAddress": "http://localhost:8081/",
"ClientRootAddress": "http://localhost:8081/",
"CorsOrigins": "http://localhost:8081,http://localhost:8081"
},
Do I need to add another Website in IIS for host? If Yes, where should I point it to? Again wwwroot? All the DLLs and appsettings.json are above the wwwroot. Should I bring them all inside the wwwroot?
When I navigate to the localhost:8081 I get "Resource not found" prompt
I noticed that there is a Web.Host.exe file in the Published folder. When change all above settings to localhost:5000 and execute it, it runs the host on localhost:5000 and works fine for both localhost:5000/swagger and localhost:5000/app/
Do I need a website under IIS to execute the Web.Host.exe? If yes, how would I add such website? Where that port 5000 has been set for the .exe file?
If I change the website physical folder to the published folder (which holds the wwwroot folder) I get the following error (seems something is wrong with the web.config file):
You need the .NET Core Hosting Bundle.
Install the .NET Core Hosting Bundle on the hosting system. ...
a. Navigate to the .NET All Downloads page.
b. Select the latest non-preview .NET Core runtime from the list (.NET Core > Runtime > .NET Core Runtime x.y.z). ...
c. On the .NET Core runtime download page under Windows, select the Hosting Bundle Installer link to download the .NET Core Hosting Bundle.
...
Restart the system or execute net stop was /y followed by net start w3svc from a command prompt. Restarting IIS picks up a change to the system PATH made by the installer.
Reference: https://learn.microsoft.com/en-us/aspnet/core/publishing/iis?tabs=aspnetcore2x

Deploy files in the localState folder during installation of a store app

I am building an app for windows store and I need some default and example data to be in the localstate folder (Windows.Storage.ApplicationData.current.localFolder) when the app run the first time.
The folder and files structure is a bit complex and I tryed to copy the files at the start of the application, but I can't manage that way.
Is it possible to have files being copied automatically from the installation folder to the localstate folder during the store app installation?
Unfortunately, customization of the app install process isn't currently supported. You have to do this as part of your first run processing.
One possibility is that you include the data in your package as a .ZIP or other compressed file and use an appropriate library to expand that file into a folder structure on startup. That could simplify your logic considerably. (I don't have a library to recommend; it's just an idea.)

Getting only pages from one liferay server to another

I have my liferay server installed on local machine.
I have created pages and an organization.
I want to have the same structure on another machine. H
What all files do i need to copy from this folder to another machine?
Just take the SQL export and the data folder from liferay-portal. Replace this data folder on the other machine and point it to the DB. SQL files will have the organizations and the pages while data folder will have the documents, images and other contents required to initiate the liferay portal.

iPhone application, Documents directory on Mac

I'm reading through some of the documentation about File Management on iOS. When you create an application for the simulator, does the application get created somewhere on my hard drive? If so, where is it?
Also, does this have access to the Documents directory? Like if I create some test .txt file, and want to see it in the App->Documents folder, is that possible? Thanks.
Yes. Look here:
~/Library/Application Support/iPhone Simulator/4.3.2/Applications
Change the 4.3.2 to be the version of the Simulator you are using.
Within that folder you will find your apps, except the they are named cryptically. Open one of those folders and you will find your app, named as you recognize it, and the Documents, Library and tmp folders. Documents is where you find the docs that your app creates and uses. You can, in fact, makes changes to the files in the Documents folder or just access their content to see what your app sees or writes.
Under XCode 6, the document directory for your app is quite hidden:
~/Library/Developer/CoreSimulator/Devices//data/Containers/Data/Application//
You can find the directory for your app with this command:
$ sudo find ~/Library/Developer/CoreSimulator/Devices -name <APP_NAME>.app | grep -o '.*/'