You need to sign in to do that
Don't have an account?

cant upload file from salforce to drive
i cant upload file from salesforce to google drive. This is my code for uploading file.
public PageReference DriveUploadAuth()
{
document.AuthorId = UserInfo.getUserId();
document.FolderId = UserInfo.getUserId();
try
{
insert document;
}
catch(DMLException e){
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Error uploading file'));
return null;
}
finally {
document.body = null; // clears the viewstate
document = new Document();
}
PageReference pg = new PageReference(GoogleDriveAuthUri (key , redirect_uri)) ;
return pg;
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'File uploaded successfully'));
return null;
}
it will redirect me. bt I cant upload documents on google drive
need help
Thnx,
Ashmi
public PageReference DriveUploadAuth()
{
document.AuthorId = UserInfo.getUserId();
document.FolderId = UserInfo.getUserId();
try
{
insert document;
}
catch(DMLException e){
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Error uploading file'));
return null;
}
finally {
document.body = null; // clears the viewstate
document = new Document();
}
PageReference pg = new PageReference(GoogleDriveAuthUri (key , redirect_uri)) ;
return pg;
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'File uploaded successfully'));
return null;
}
it will redirect me. bt I cant upload documents on google drive
need help
Thnx,
Ashmi