-
help : Custom object on Salesforce visualforce page not working in Internet Explorer
Hi i have one custom object and which is having one Salesforce Visualforce page and Controller as posted below. In there we can drag and drop (or)we can attach multiple files at a time ,which is working fine in "Google Chrome" for both functionality.But The drag and drop functionality is not working in "Internet Explorer",So Can you please help me to fix the problem?
Visual Force Page-----><apex:page standardController="Customobject__C" extensions="AttachmentActionFunction">
<script type='text/javascript'>var newWin=null;
function openLookupPopup()
{
var url="/apex/docutype/";alert('$$$$$$$$$$'+ur1);
newWin=window.open(url, 'Popup','height=500,width=600,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no');}
function closeLookupPopup()
{
if (null!=newWin)
{
newWin.close();
}
}var maxStringSize = 6000000;
var attachmentList;
var j;
function uploadFiles()
{
input = document.getElementById('fileinput');
attachmentList = input.files;
if(j == undefined)
j = 0;
var file;
if(j < attachmentList.length)
{
file = attachmentList[j];
var name = file.name;
var reader = new FileReader();
reader.onload = function(e) {
var attachmentbodybase64 = window.btoa(reader.result)
console.log(attachmentbodybase64.length);
if(attachmentbodybase64.length > maxStringSize )
alert("File size is too large to handle");
else
{
j++;
saveFileAF(attachmentbodybase64, name);
}
}
reader.readAsDataURL(file);
}
else
{
console.log('this is end');
var url = window.location.origin + '/'+"{!$CurrentPage.parameters.Id}";
console.log(url);
window.location.href = url;
}}
</script><script>
function test(){var url="/apex/docutype";
newWin=window.open(url, 'Popup','height=500,width=600,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no');
console.log('$$$$$$$$$$'+ur1);
if (window.focus)
{
newWin.focus();
}return false;
}
</script><apex:form >
<input type= "file" Id= "fileinput" multiple="multiple" />
<apex:commandButton value="Upload" onclick="test(); return false;" />
<apex:actionFunction name="saveFileAF"
action="{!saveFile}" oncomplete="test()" rerender="form" status="uploading">
<apex:param name="base64File" value="" assignTo="{!base64}"/>
<apex:param name="fileName" value="" assignTo="{!fileName}"/>
</apex:actionFunction>
<apex:actionStatus id="uploading" >
<apex:facet name="start" >
<img src="/img/loading.gif" />
</apex:facet>
</apex:actionStatus>
</apex:form>
</apex:page>Controller---->
public class AttachmentActionFunction {
public transient String base64;
public Customobject__C Ins;public List<Attachment> mulfiles{get;set;}
public Pagereference gotonewpage()
{
PageReference pageRef = Page.AttachmentActionFunction;
pageRef.getParameters().put('msg','success');
return PageRef;
}public AttachmentActionFunction() {
mulfiles=new List<Attachment>();}
public String getBase64()
{
return base64;
}
public void setbase64(String base64)
{
this.base64 = base64;
}
public String fileName {get; set;}
public AttachmentActionFunction(ApexPages.StandardController std)
{
Ins = (Customobject__C)std.getRecord();
}
public void saveFile()
{
Attachment a = new Attachment(parentId = Ins.id, Body = EncodingUtil.base64Decode(base64), name = fileName);mulfiles=new List<Attachment>();
mulfiles.add(a);
//insert a;}
public PageReference saveinline() {
return null;
}
}
Log In to reply.
Popular Salesforce Blogs
![](https://images.forcetalks.com/wp-content/uploads/2022/09/30094733/sa_16645312255%20Best%20CRM%20Integrations%20with%20QuickBooks%20for%20SMBs%202022.png)
5 Best CRM Integrations with QuickBooks for SMBs 2022
It's crucial that your CRM and QuickBooks work together. Due to this, most CRMs on the marketplace have acted and offered a method to integrate…
Salesforce Visual Composer – Populate any PDF with Salesforce Data
There are many uses case that will require your customer to manually sign a Document, few examples are: NDA, Contract or Power of Attorney. In…
![lightning design system](https://images.forcetalks.com/wp-content/uploads/2022/11/09181140/lightning-design-system.jpg)
Learn About Lightning Design System in Salesforce
What is the Salesforce Lightning Design System? Should I use it? It's easy to forget the days before Bootstrap when web developers had to painstakingly…
Popular Salesforce Videos
Access & Permissions in Salesforce | Profiles, Permission Sets, Sharing Settings
User permissions and access settings specify what users can do within an organization: Permissions determine a user's ability to edit an object record, view the…
Salesforce Certification Registration, Check and Verify Certification Status, Trailblazer.me Profile
All About Salesforce Certification:- Schedule your Salesforce Certification Exam Link Your Salesforce Certifications to Your Trailblazer.me Profile Check & Verify Your Salesforce Certification & Maintenance…
New Product: RepBlaze on Salesforce AppExchange
Visit on AppExchange: Click Here As a Sales manager, if you deal with 1000’s of inbound and other leads everyday and would love to automate…