Can I specify a document type with a doubled suffix? - iphone

Our app has a document type which uses the suffix .sgb. It's a package type, so in a lot of cases users zip them up and send them as .sgb.zip.We can't ask our users to rename them to .sgbz. I've added .zip files as a document type to our app, and it's opening the .sgb.zip files; but the OS is offering my app to the user to open all .zip files. I've tried specifying sgb.zip as a new document type, but it just gets ignored. Can I specify a document type with the suffix .sgb.zip somehow, or do I have to open all .zips and see whether they have a .sgb file in them?

Related

How to get readable File on Android 11

Is there any way on Android 11, except asking for MANAGE_EXTERNAL_STORAGE permission, to get readable File.class of some, non-media, file?
Using Storage Access Framework and DocumentFile I can get Uri (both canRead and canWrite return true), but when I convert it to File, both canRead and canWrite return false (exists return true).
Files my App is using are large SQLite databases created by Users on their computers, which I only read (if it makes any difference), but in order to do that, I need File, instead of Uri.
Currently, my options are:
Asking my Users to find some way to copy files directly to data/data directory (which is not visible to computers and most file managers)
Copying files (using input/output stream) to data/data directory (which means that 500MB file will take 1GB of internal storage on Device)
Applying for MANAGE_EXTERNAL_STORAGE permission, which I doubt Google will approve
Am I missing something?

Can OpenXML be used to launch a new Word instance?

I'm able to generate Word documents without issue. I save the resulting *.docx file to a temporary location and then need to launch the file in Word.
The requirement is to not "open" the file in Word (easily done with a Process.Start) but to have load into Word as a new unsaved file. This is because certain propriety integrations for Word need to take over when a user saves the file and don't kick in if the file is ready saved but to a location on disk.
I've achieved this by using Interop calls to the Word application, adding the new document to Word's workspace. My problem is with Interop which tends to break on various client machines, particularly when Office upgrades take place (say a client had 32-bit office but upgraded with a 64-bit version).
I'm somewhat new to OpenXML, but can it be used to automate Word or is Interop my only real option?
object oFilename = tmpFileName;
object oNewTemplate = false;
object oDocumentType = 0;
object oVisible = true;
Document document = _application.Documents.Add(ref oFilename, ref oNewTemplate, ref oDocumentType, ref oVisible);
No, the Open XML technology has no way of interacting with the Office (Word) application - it's for file creation/manipulation, only. The interop is required in order to do anything with the Word application.
There is sort of a way around this - and it's only possible with Word, no other Office application has this - is to convert the Open XML content to the OPC flat-file format. This "concatenates" the various packages that make up the zip file to a pure text string, essetially a single XML file.
XML content in the OPC flat-file format can then be written to an already opened (even newly created) Word document using the Range.InsertXML method via "the interop". In a way, this "streams" the Open XML content into the opened Word document.
The problem with this approach is that certain document-level properties are not written to the target document, so not all aspects of the opened document can be changed. For example: page size, orientation, headers, footers... So if this kind of thing also needs to be affected the interop is required for such settings.

How to start Microsoft Word from Java FX with parameters to run a macro

I have a document management system which stores files in a MS Word format. In my application, I would like to be able to open that document in Word.
I would like Word to handle all of the file system access out of the content management system. What I need to do is the following:
1) Create a new document based off a template, and then provide information that can be parsed and placed into specific fields.
I see I can do this as follows:
Runtime.getRuntime().exec("C:/Program Files (x86)/Microsoft Office/Office15/winword.exe /ttemplate_name");
My assumption here is that the template is installed on the local drive. However I would like to provide some data so that fields could be prepopulated and I am not sure how to do that?
2) I would like to be able to run a macro to open the document directly from the content management system. I think I can run a macro as follows:
Runtime.getRuntime().exec("C:/Program Files (x86)/Microsoft Office/Office15/winword.exe /mmacro_name");
However, in this case, I would need to provide the document id from the content management system so that it can retrieve it and open it.
I am unsure what switch or parameter I can use to provide the additional data for word?
Thanks!
Word provides no command-line facility to pass arguments or data when opening or creating a document.
As long as macro code is available, the macro can read data that's stored somewhere, such as in an XML file. But the file path would need to be hard-coded or derivable from a known location (path).
You don't necessarily need to call a macro in a document (or template attached to the document). If the macro is named AutoNew or AutoOpen it will execute automatically when a document is created from the template or, respectively, when a document is opened.

Filepicker.io gives "does not register as an accepted file" error when extension is allowed

I have a filepicker.io instance where I am using the pickAndStore function to allow users to upload various files, however while testing Microsoft Visio I found the files are being blocked / denied upload by a yellow error that states it does not register as an accepted file type (and lists out all the files it believes are allowed)?
In my logs of the arguments sent to the function, I can see the full array of file types I allow and the 4 variants of visio I added are clearly there:
The four I added:
".vss", ".vssx", ".vsd", ".vsdx"
Full array:
[".doc", ".dot", ".docx", ".docm", ".dotx", ".xls", ".xlt", ".xlsx", ".xltx", ".xlsm", ".xlsb", ".oft", ".msg", ".ppt", ".pptx", ".pptm", ".pps", ".ppsx", ".mpp", ".pub", ".pdf", ".html", ".mhtml", ".txt", ".rtf", ".csv", ".xml", ".css", ".zip", ".tar", ".rar", ".vss", ".vssx", ".vsd", ".vsdx", ".mp3", ".wav", ".swf", ".ics", ".srt", ".wmf", ".eps", ".ai", ".psd", ".gif", ".jpg", ".jpeg", ".png", ".bmp", ".m4v", ".mp4", ".flv", ".f4v", ".mov", ".wmv", ".wm", ".webm", ".3gp", ".3gpp", ".m2p", ".rv", ".rm", ".avi", ".3gp2", ".mpg", ".mpeg", ".ts", ".vp6", ".h264", ".arf", ".wrf", ".m2ts"]
However When I use "My Computer" as a source and upload any one of the twenty odd .vsd files I have to use as tests, all of them trigger the error to appear and deny upload:
The image i am seeing saying that .vsd does not register
I'm not sure what else I can do at this point to fix? I don't particularly want to have to use mimetype in this one instance as it suggests not to use this along side extension in the filepicker documentation.
Here is the link i used that provides various Visio files you can use to test. I would rather not use the files clients upload using our platform as I would need to ask permission and in case they are sensitive. I don't think there has been a single successful upload (of a visio file, others are fine) so I would be surprised if it was file specific.
https://www.microsoft.com/en-gb/download/confirmation.aspx?id=24023
Thanks!
All extensions are converted back to mimetype therefor you can't mixed extension & mimetype.
It appears that ".vss", ".vssx", ".vsd", ".vsdx" are in the database.
Could you post some of the files you are testing so we can check them ourselves.
Regards,
Dylan
Filepicker needs to include "application/vnd.ms-visio.viewer" in the mapping from those file extensions. It looks like that's what the browser is reporting the MIME type for those files to be.

How can I rename file uploaded to s3 using javascript api?

'pickAndStore' method allows me to specify full path to the file, but I don't know it's extension at this point (file path has to be defined before file is uploaded, so it's not possible to provide a path with correct extension).
if I use 'pick' and then 'store' I have 2 files (because both methods uploads file to the s3). I can delete 'old' file, but it's not optimal and can be pain (take ages) with really big files.
Is there any better solution? Ideally to rename existing file.
Currently, there is no workaround for renaming file.
However, in our Javascript API v2 we are planing to add new callback function. onStart callback will be fired after user pick file but before file uploading. There could be option like renaming file based on original filename.
We will keep you updated.