In IBM Lotus Notes PutInFolder() methods add mail document in Follow UP folder? - c#-2.0

objdoc.Save(true, false, true);
objdoc.PutInFolder(objth.t_PutInFolder, true);

Related

Can't copy file and convert mime type with Google Drive Api

I created a new google doc successfully in my drive, but now I wish to change the file type from 'application/msword' to 'application/vnd.google-apps.document'.
I tried to use the answer here to copy the file, but it's not working:
convert a Word doc into a Google doc using the API via nodejs using drive.files.copy convert in v3 of Google Drive API
The code I have is similar to the above question.
After I create the document as msword I am trying to make a simple copy to convert it to a google doc.
drive.files.create({
requestBody: body.requestBody,
fields: 'id',
}, function (err: any, file: any) {
if (err) {
console.error(err);
} else {
drive.files.copy(
{
fileId: file.data.id,
requestBody: { // You can also use "resource" instead of "requestBody".
name: 'copy',
mimeType: "application/vnd.google-apps.document"
}
},
(err, res) => {
if (err) return console.log("The API returned an error: " + err);
console.log(res.data); // If you need, you can see the information of copied file.
}
);
}
the error I'm getting is
Conversion of the uploaded content to the requested output type is not supported.
Any help is appreciated, thanks!
After making some tests with different mime types from Microsoft Office, it looks like the Office editing mode from Google Drive is unable to read blank files and therefore you were getting the error message.
If I am not mistaken, the way Google Drive works to change files formatting is that they need to open the file first in order to read the information and change the formatting. However, in this case Google Drive is recognizing these blank files as corrupted files and is unable to open them using the Office editing mode.
This looks like an expected behavior but could also be considered as a bug from this specific feature. I would recommend you to post your question in the Google Issue Tracker and explain the behavior and testing you have done so far so that you can confirm if this is just expected or a bug from the Office editing mode.
Reference:
Google Drive Office editing mode
Google Issue Tracker

Share Sheet in iOS not showing Image of the website

I have implemented an Ionic project in which you can share a link to the social media using the Native Share action sheet link popup in ios. All works well except that when the sharing window is open(the native ios window) i dont see the image of my website. What could be wrong?
I am using Ionic 4 and https://ionicframework.com/docs/native/social-sharing plugin.
I am creating the Branch link using below code
data: {
'custom_bool': true,
'custom_int': Date.now(),
'$og_title': 'project name',
'$og_description': 'some text' ,
'$og_image_url': this.projectData.projectImage,
"$custom_fields": {"projectId": this.projectData.projectId},
}
};
branch.link(linkData, (err, link)=> {
console.log(link);
this.projectData.shareURL = link;
// use this URL in another page, some logic
})
using the Plugin (SocialSharing) I am doing the below code
socialSharing.share("some text", "some text", null, 'this is the previous obtained URL')
This is what I mean by icon not seen

Create google sheets on team drives through API's

Below code creates a google sheet on My Drive but what if I had to place this to a folder on team drive?
I would like to modify createNewSpreadSheet function in such a way that it uploads file to specified folder of team drive.
function createNewSpreadSheet(auth) {
const sheets = google.sheets({version: 'v4', auth});
const resource = {
properties: {
title:'SampleSheet'
},
};
sheets.spreadsheets.create({
resource,
fields: 'spreadsheetId',
}, (err, spreadsheet) =>{
if (err) {
// Handle error.
console.log(err);
} else {
console.log('spreadsheet::',spreadsheet.data.spreadsheetId);
}
});
}
// Load client secrets from a local file.
fs.readFile('credentials.json', (err, content) => {
if (err) return console.log('Error loading client secret file:', err);
// Authorize a client with credentials, then call the Google Sheets API.
authorize(JSON.parse(content), createNewSpreadSheet);
});
You may check this blog on how to import/upload files to Team Drives folders.
Uploading files to a Team Drives folder is also identical to to uploading to a normal Drive folder, and also done with DRIVE.files().create(). Importing is slightly different than uploading because you're uploading a file and converting it to a G Suite/Google Apps document format, i.e., uploading CSV as a Google Sheet, or plain text or Microsoft Word® file as Google Docs. In the sample app, we tackle the former:
def import_csv_to_td_folder(folder_id, fn, mimeType):
body = {'name': fn, 'mimeType': mimeType, 'parents': [folder_id]}
return DRIVE.files().create(body=body, media_body=fn+'.csv',
supportsTeamDrives=True, fields='id').execute().get('id')
The secret to importing is the MIMEtype. That tells Drive whether you want conversion to a G Suite/Google Apps format (or not). The same is true for exporting. The import and export MIMEtypes supported by the Google Drive API can be found in my SO answer here.

IOS save PDF after accessing from WebView, Cordova

I have an app that displays me a website (uiwebview). In that website i have some LINKS that open me pdf s in webview. What do i want is... can i make, if i'm pressing on a link, pdf to download it instead of open it? Thank you.
Could you perhaps put some code up? It might to understand your requirement a bit better
Cordova-PDFReader-IOS
To install from command line:
cordova plugin add com.lesfrancschatons.cordova.plugins.pdfreader
Supported URI scheme: file For other schemes, please download it first with cordova plugin fileTransfer.
//Open a pdf
PDFReader.open('absolutepath.pdf', options, success, error);
//Available options
{
password: null,
flatUI: true,
showShadows: true,
enableThumbs: true,
disableRetina: false,
enablePreview: true,
bookmarks: true,
landscapeDoublePage: true,
landscapeSingleFirstPage: true,
toolbarBackgroundColor: null,
textColor: null,
enableShare: false,
page: 2
}
//Event when PDF Reader is closed
document.addEventListener('PDFReaderClosed', function() {console.log('closed');})
//Clear PDF Reader cache
PDFReader.clearCache(filePath, finishedCallback);

Reimporting an EML file through IMAP

I have a bunch of .eml files exported/archived using 'archivemail'. Now I need to restore
some the files completely on the IMAP server. Is there some simple tool taking an .eml/mail file with multiple emails and restoring it on an IMAP server
You can use Mail.dll .NET IMAP library for that:
using (Imap imap = new Imap())
{
imap.Connect("server"); // or ConnectSSL
imap.Login("user", "password");
string eml = File.ReadAllText("email.eml");
imap.UploadMessage("INBOX", eml);
imap.Close();
}
Mail.dll can also parse the .eml files if you need to implement some custom logic before uploading:
IMail email = new MailBuilder().CreateFromEml(eml);
Please note however that this is a commercial product I helped to develop.

Resources