function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kumar BittuKumar Bittu 

Invalid Page Redirection - While Posting File Data to Apex Controller using action:function

Hi All,

I am trying to upload file & attach with SFDC object , So I tried by using apex:fileinput but it is not working with my existing code because of rerendered issues. So Now I am trying using javascript to upload file but I am not able to pass the file data to apex controller using javascript.

Issue - Not able to pass file data using action:function parameter.

I am reffering to below URL -
http://manojjena20.blogspot.com/2015/11/apexinputfile-can-not-be-used-in.html

Please help me out.
Thanks in Advance.
Venkateswarlu Marri 13Venkateswarlu Marri 13
Hi Kumar Bittu,
You have go to this URL-

https://salesforce.stackexchange.com/questions/24175/passing-method-parameters-with-apexactionfunction
 
Kumar BittuKumar Bittu
Thanks Marri for your response.
But I am using the same process , which is provided in your URL.
<apex:actionFunction name="passToController" action="{!doAttachment}" reRender="frm">
<apex:param name="fname" value="" assignTo="{!filename}" />
<apex:param name="body" value="" assignTo="{!body}"/>
</apex:actionFunction>


But the problem is that we cannot pass file body data using actionFunction param. that is issue I am not able to get the body of file.

If you have any script , which upload file using javascript then please help me out.