Select file destination CrossFilePicker.Current.SaveFile(fileData) Xamarin Forms - xamarin.ios

I'm using Xamarin.Dialog.Plugin.FilePicker to pick a text file, and it works for me, but when I want to save a text file using CrossFilePicker.Current.SaveFile(fileData), a file destination picker is not openning.
Any sugestion to save a file on a destination from my choose using Xamarin Forms?

I think the SaveFile() is not doing what you expect. When you look e.g. at the Android implementation, it only saves the file to the external storage folder for the app. It's not meant to open a "save file" requester.
The real solution depends on your use case. If you want to open the file in another application, you have to implement a ContentProvider and open a content:// URL that your app handles, by using Intent.ActionView or similar. There currently is no Xamarin Plugin for doing this.

Related

Automatically select save option in webbrowser file download dialog box

I have a c# desktop app which connects to a site via a web browser control. The problem is I need to navigate to a specific section and download a excel file which is generated from a postback. I would like to either automate this process or bypass the file download dialog and save the file directly to a local drive.
Problem
The link is not a standard url. The site uses a postback script to get the file needed which then displays the file download dialog box. E.g. When you click on the button (javascript: postback) the file download dialog box is automatically loaded.
As stated I want to bypass the save options and automatically store the file in a predefined location. Any help would be much appreciated.
I find AutoIt http://www.autoitscript.com/site/autoit/ very useful for these kind of tasks. If you want to integrate it with your C# app, then you can call your AutoIt script via system calls. The difficulty is finding and following the link on the page, that will depend on how the page is laid out.

Excel template in sharepoint - how to open as a new file from template?

I need to place an excel template in sharepoint and give people a link to it. I would like to prevent users from changing the template. I do not want users to save any file in the library. There are couple of solutions:
- revoke people sharepoint right to change the file,
- keep the file checked-out to me.
I also think about other scenario. Currently file is in .xlsm format (macro enabled workbook) but I am thinking about .xltm (macro enabled workbook template) as a way of forcing client excels to treat the file as template only. It looks like excel stubbornly wants to save the file (downloaded from sharepoint) as a template in source location and not as the new file. Only when I open the template directly from my local drive do I get what I need.
How do I force sharepoint/excel to use .xltm file stored in sharepoint as a template for a new file?
Isn't it a matter of incorrect http content disposition header?
If you reference the template file using a file path rather than the HTML path, it should open as a new document, rather than opening the original template e.g. use
\\SiteCollection\Site\DocumentLibrary\Template.xltx
instead of
http://SiteCollection/Site/DocumentLibrary/Template.xltx
In some cases making your Excel file a template for a content type or a library will do want you want. If you set some document library a template file this way all your new files in this library will be created from this file. Check out the Advanced Settings of a document library. There is a section Document Template that does the trick. If this section is disabled then your library has Content Types Management enabled and this means that you have to check the Advanced settings of a content type to set the template.
This solution makes all new files be created in the document library but not on a desktop but if you can live with that please be kind to mark as an answer.
If you want a link that can be sent out using mails you can use:
http://SiteCollection/Site/_layouts/15/download.aspx?SourceUrl=%2FSite%2FDocumentLibrary%2Template%2Exltx

Change file extension in SharePoint

I'm trying to find out how to change the file extension of a file in a document library in SharePoint, so that a newer version with a different extension can be uploaded without a separated copy being created (e.g. suppose I want to replace a .doc file with .zip).
Looks like you can write some codes to workaround but I feel there's gotta be a simpler way to do a simple task like this.
You could change the extension by opening the library in windows explorer.
Actions - Open In Windows Explorer
Then ensure that in your file view settings you don't have 'Hide Extensions for known file types' enabled.

how do I mark a file as a data file in a visual studio 2010 vsto clickonce application?

I'm making a Word 2007 add-in with C# 4.0 in Visual Studio 2010. I need an Access 2007 database (a .accdb file) to be placed in the data directory by the clickonce installer. Unfortunately, the file is getting put elsewhere, so the application can't find it at runtime. I've seen various articles refer to using the Application Files dialog on the Publish tab of the project properties to mark the file as a data file, but I have no Application Files button for some reason.
Any idea how to make the Application Files dialog appear, or some other way to manually mark my .accdb file as a data file?
In the Solution Explorer, if you set the file's property to be Copy to Output Directory = Copy Always. Then when you go to Application Files they should default as a Data File.
However, since this is your database I would consider looking at make it safe across updates so you might consider this post.
See http://msdn.microsoft.com/en-us/library/dd465298.aspx
By the way, "Application Files" button should be on the project properties' Publish tab.
VSTO Applications do not have the Application Files button available, and you can't set the file types specifically. If your file is not being deployed to the data directory and you want it to be, rename it with a file extension that is marked by ClickOnce as data. This includes .xml, .mdb, and .mdf. Otherwise, the file is deployed with the VSTO application and will be in the same location as the rest of the files.
The location of the deployment files for a VSTO application can be discovered programmatically this way:
System.Reflection.Assembly.GetExecutingAssembly.CodeBase
You might want to move the database, though, because unless you deploy it as data, it will be lost when an update is performed. Or you can check out this article about where to put your data to keep it safe from ClickOnce updates.
I was able to get things to work by using the Mage tool as described here:
http://msdn.microsoft.com/en-us/library/6fehc36e.aspx
The trick with MageUI is it's open file dialog assumes you want to open a manifest associated with a .exe; a vsto project has a .dll, so the manifest doesn't appear in the files list by default, which was really tripping me up.
Basically, this process is a pain because you have to remember to do it manually. I don't know if there's a way to make this part of the build (maybe a post-build step? But this is really a post-publish step).

reading excel file from browser in the jsp

I am new to Jsp. I am developing the tool for testing usage, and have succeeded to open the excel file in the browser from the jsp application. However, i am not able to modify or edit the opened excel sheet.
Please help how to modify the excel in the browser.
You cannot do this when displaying the file inline in a browser or doing a 'Open file' when getting a download popup. Simply because the file is then copied into client's disk file system. If you save the edits, it's saved in the same copy on the client's disk file system. This does not affect the original file in the server side in any way.
There are basically 2 ways to achieve your requirement:
Let client download a copy of the excel file and store it in the client side disk file system, so that the client can edit and save it locally. Give the client the possibility to upload the edited file back. In the server side just replace/backup the original file.
Use HTML forms the smart way to mimic an Excel sheet and use a Java Excel API (Apache POI, JExcelAPI, etc) to map between this data and the actual Excel file which is stored in the server side disk file system.
Have you looked at JExcel?
The FAQs also explain how to use the API with jsp.

Resources