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
Chidambar KulkarniChidambar Kulkarni 

Salesforce1 - attach photo to custom object and Navigation

I am new to Salesforce.  
After doing a bit of research, I have come up with the following code (I apologize if part of the code doesn't make sense).   
I have created the following visualforce page

        <apex:page standardController="PVID__c" extensions="AccountController"> 
            <script src="/soap/ajax/29.0/connection.js"></script>
            <script type='text/javascript' src='/canvas/sdk/js/publisher.js'/>
            <script src="https://mobile1.t.salesforce.com/soap/ajax/30.0/connection.js" type="text/javascript" />
            <script>
            function myUpdate()
            {
            var accountId = document.getElementById('accountId').value;
            
            Visualforce.remoting.Manager.invokeAction(
            '{!$RemoteAction.AccountController.StandardController}', accountId, function(result, event)
            {
             if(result!=null) sforce.one.navigateToSObject(result,"detail");
            Sfdc.canvas.publisher.publish({name: "publisher.close", payload:{ refresh:"true"}});
            
            });
            }
            </script>
                
            <apex:form >
                
                <h1>Visit</h1>
                <table cellspacing="20"> 
                    <tr>
                        <td>Local Spaces</td>
                    </tr> 
                    <tr>            
                        <td style="padding:0 15px 0 15px;" ><apex:inputField value="{!PVID__c.Common_Areas_Text__c}" style="width: 300px; height: 50px"/></td>
                        <td style="padding:0 15px 0 15px;" ><apex:inputField value="{!PVID__c.Common_Areas_Rating__c}" style="width: 120px; height: 20px"/></td>
                    </tr>     
                </table>
            
                <input id="photoFile" type="file" accept="image/*"/>
                
                <a href="#" data-role="button" onclick="myUpdate()">Save</a>
           
            </apex:form>
    </apex:page>

My AccountController apex class

    public with sharing class StandardController {
        public ApexPages.StandardController standardController { get; set; }
        public StandardController(ApexPages.StandardController standardController) {
            this.standardController = standardController;
        }
    }

What I am finding hard to accomplish.  

1. Attaching a pic to my custom-object (PVID__c)  

2. By default, when you press back button on android Salesforce1 app, it closes. I want to navigate back to previous visualforce page.


Errors:

User-added image

Any help is appreciated, thanks.