When I deploy windows store app, I want a file to be placed at ApplicationData.Current.LocalFolder. How to? - c#-4.0

When I deploy windows store app, I want a file to be placed at ApplicationData.Current.LocalFolder so that I can read that file from ApplicationData.Current.LocalFolder.
How to do it?
The problem actually is that I place my file at ApplicationData.Current.LocalFolder, I know where this file is located in my computer. Then I read from this location in my app. But when I upload this to windows store, the app cannot find the file at: ApplicationData.Current.LocalFolder. Please please please help me with this!!!

The app can only deploy files to its install directory, not to its application data. Instead you can copy the file from the install direction on first run the first time the file is needed.

Related

How to setup file upload from NodeJS/VueJS to another server?

I've created a VueJS App for file uploading in which it will be my admin panel (For CMS) with NodeJS as back-end. Now I want to upload the files that was passed to the NodeJS and move it to another VueJS App which is going to be my primary website in order for me to access the files locally. How can I do it? Any suggestions or different approach will do.
You have many options on how to move the files to another site.
You could store them in a shared bucket or shared directory between your 2 backends or you could add another route to download that file.
You could configure a cronjob to scp or rsync those files to your target machine.
This is really more of a question of how to sync a directory to some place else.

How to create or use Local Folder in Azure?

I have a required to download a file from SFTP server and the file downloaded is stored to local folder say "D:\Data\tempData.csv"
I have to read the data from local file and consume in my application for other data manipulation.
This job is created using web hooks scheduler in Azure Web Jobs.
I am unable to download file to azure and then read from there.
Can some one help me to use a location for temp data which is equivalent to "D:\Data\tempData.csv" in local system in the azure environment.
Suggest a place in azure where can I download file and then to read from there.
Thanks in Advance.
What I tried?
Tried using SSH.NET dll to download file from SFTP to local folder
Again to read from local folder to my application
Tried looking at BLOB storage usage, which was not approved Tech Arch.
In an Azure Web App, you can create files anywhere under d:\home (for persistent files) or under d:\local (temporary files). See this page for more details on the file system. Try using Kudu Console to see those locations.
How you get the file in that location sounds mostly unrelated to your primary question about what location you can use.
In Azure Environment, the "Web-Jobs" are stored in its local folder where known as "D:\home" and "D:\local" is the local folder used by the Web-hooks.
I was in need to use a folder for temporary usage of downloading a file from SFTP server and again read the file from that local temporary location file and consume it in my application.
I have used the "D:\local\Temp" as the temporary folder which is created by the code after checking the folder existence, then after creating the folder the code will download a file from server and store to this location and then read from the same location and delete the file from that temporary folder.
Thanks all for your help, #David Ebbo Thanks.

How do I reference a text file from an Azure WebJob?

I'm creating a web job on Azure that is going to be a c# console application (.exe). Inside this program I need to read a text file from the file system. Is there a way to include the text file I need in the executable? Where do I put the file and how do I reference it?
I also don't want anyone (via the website) be able to access the file.
Just deploy the text file alongside the executable, and you'll be able to open it in the current folder.
If deploying the WebJob from Visual Studio, make sure to mark the text file's properties as 'Copy if newer' to make sure it gets deployed.
Follow instead of putting a file location in the value as parameter
just put this as I show you here
Put it in Appconfig file for path as
to copy this text file into your bin/debug folder to
Make zip folder as usual, put that test file int "debug.zip"

How to deploy application in windows azure with text file?

I have created a mvc4 application with text file. I write some data in a file "ddd.txt". I wrote such address at my PC: "#D://Project//ddd.txt" and it worked finely. However, when I deploy my website on "azurewebsites.net", then I should write another address.
It is very important text file for me. And I would like to read data from it.
What address of directory should I write in my application to work him on Windows Azure server?
I would try using App_Data (you can just add the directory if it doesn't exist in your project).
You could then load the file like this:
string path = HttpContext.Server.MapPath("~/App_Data/ddd.txt");
// load file here
The other option would be to store it in Blob storage, there is a good walkthough of the different features here: http://www.windowsazure.com/en-us/develop/net/how-to-guides/blob-storage/

how to store .bat file in azure, execute it and connect to it

I'm new in windows azure but I already know how to deploy my service in azure. I need to have sth like a folder in azure to store some text files, two .exe files and one .bat file. then I want my deployed service to use these files and execute .bat file and create some new text files on that folder.
My question is if there is sth like the folder that I need?how to execute it? and how is it possible to connect to that folder through my wcf service?
I really appreciate your help.
If you want that bat file to execute one time i.e. during role start up, you can use start up task.
If you want to execute bat file during WCF call, you can use .NET process class. However for executing this task, you may require higher privileges.

Resources