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
Vishal Taware 9Vishal Taware 9 

HTML5 Input type="file" tag is not working in salesforce1

Hi,

I created one visualforce page with a html5 tag <input id="image" type="file"/>.

When I access that page from salesforce1 and click on "Choose File" button, then salesforce1 app gets crashed. But if I access the same page from Safari browser of my iPad then it works fine. Also in last version of Salesforce1(6.0) was working fine with ios7.

Thus, it looks like Salesforce1 might have a compatibility issue with ios8.0.2.

Thanks,
Vishal
Best Answer chosen by Vishal Taware 9
Vishal Taware 9Vishal Taware 9
Its a known issue in salesforce 
https://success.salesforce.com/issues_view?id=a1p300000008X8YAAU

All Answers

shiv@SFDCshiv@SFDC
Please try with VF tags

<apex:form id="theForm">
      <apex:pageBlock>
          <apex:pageBlockSection>
            <apex:inputFile value="{!document.body}" filename="{!document.name}"/>
            <apex:commandButton value="Save" action="{!save}"/>
          </apex:pageBlockSection>
       </apex:pageBlock>
  </apex:form>
public class documentExt {
    public documentExt(ApexPages.StandardController controller) {
        Document d = (Document) controller.getRecord();
        d.folderid = UserInfo.getUserId(); //this puts it in My Personal Documents
    }                 
}

Thanks,
Shiv

If it resolve your Issue please mark answer as solution.



Vishal Taware 9Vishal Taware 9
Hi Shiv,

I tried this code snippet as well but it doesnt work on Salesforce1 app.
shiv@SFDCshiv@SFDC
Can you please post your code with controller code.
Vishal Taware 9Vishal Taware 9
The code which you have posted, if you run the same code on Salesforce1 app then you can reproduce the crash.

Or 

<apex:page sidebar="false" showHeader="false" standardStylesheets="false" docType="html-5.0">
     <input id="imageUpload" type="file"/>
</apex:page>

Vishal Taware 9Vishal Taware 9
Its a known issue in salesforce 
https://success.salesforce.com/issues_view?id=a1p300000008X8YAAU
This was selected as the best answer
manish k 12manish k 12
I have been struggling with this problem for many days, please give someone a solution to it.
Regard, 
Manto (https://www.vbtcafe.com/)
Hindi AbhmaanHindi Abhmaan
Check Latest Updated information on Latest State and Central Government schemes at 
 <a href="https://hindiabhimaan.com">Hindi Abhimaan</a>
abhay singh 158abhay singh 158
supar   
hey my name abhay 
vizit this https://thakurblog.com/referral-code-kya-hota-hai/
johny jokerjohny joker
if is it solved this than i am very much appriciated to have the info. or else you can havee a visit https://pogohelpcenter.com/club-pogo-games-sign-in-problems