In this instance, I would use the RPC file-copy to transfer the file to the switch.
<rpc>
<file-copy>
<source>source</source> <!-- mandatory -->
<destination>destination</destination> <!-- mandatory -->
<source-address>source-address</source-address>
</file-copy>
</rpc>
source: URL of source file
destination: URL of destination file
source-address: Local address to use in originating the connection
e.g. a source URL could be:
ftp://fred:passwd@mary/ftpDir/scripts/autocfg.slax /var/db/scripts/autocfg.slax
<!-- No zombies were killed during the creation of this user interface -->
<!-- user space, class j-super-user -->
<hello>
<capabilities>
<capability>urn:ietf:params:xml:ns:netconf:base:1.0</capability>
<capability>urn:ietf:params:xml:ns:netconf:capability:candidate:1.0</capability>
<capability>urn:ietf:params:xml:ns:netconf:capability:confirmed-commit:1.0</capability>
<capability>urn:ietf:params:xml:ns:netconf:capability:validate:1.0</capability>
<capability>urn:ietf:params:xml:ns:netconf:capability:url:1.0?protocol=http,ftp,file</capability>
<capability>http://xml.juniper.net/netconf/junos/1.0</capability>
<capability>http://xml.juniper.net/dmi/system/1.0</capability>
</capabilities>
<session-id>5407</session-id>
</hello>
]]>]]>
<rpc><file-copy><source>ftp://ops:mypass@192.168.0.10/scripts/foo.slax</source><destination>/var/db/scripts/op/foo.slax</destination></file-copy></rpc>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/12.1X46/junos">
</rpc-reply>
]]>]]>
<rpc><close-session/></rpc>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/12.1X46/junos">
<ok/>
</rpc-reply>
]]>]]>
<!-- session end at 2017-02-14 12:20:01 UTC -->
I hope that this helps.
Regards,
Andy