javascript to upload file on the disk
-
Saturday, March 31, 2012 3:17 PM
is there a javascript(which can be up on crm form) to upload file on local disk.
can anyone provide a hint on code or code or reference to such code plz.
All Replies
-
Saturday, March 31, 2012 3:16 PM
is there a javascript(which can be up on crm form) to upload file on local disk.
can anyone provide a hint on code or code or reference to such code plz.- Merged by Andrii ButenkoMVP, Moderator Sunday, April 01, 2012 11:07 AM
-
Saturday, March 31, 2012 6:25 PMModeratorAre you looking to upload a file to a CRM record - like attaching a file using a note? Or do you need to upload them to a destination outside CRM?
Jason Lattimer
-
Saturday, March 31, 2012 8:30 PMi need to upload them to a destination outside CRM...
-
Saturday, March 31, 2012 11:15 PMThis cannot be done via JavaScript, because JavaScript is not allowed to access the file system from a browser for security reasons.
-
Sunday, April 01, 2012 12:13 AM
Hi,
I am assuming you are trying to upload a file from an entity form to an outside location. Is this file in any way linked to that CRM entity record, I mean is this a requirement that the file upload has to be from withing CRM?
One way you can do is to add a custom ribbon button to the entity form. On click of that you can call a JScript web resource function. In that function you can call .aspx page in which you can build your upload utiltiy.
I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful.
Ashish Mahajan, CRM Developer, CSG (Melbourne)
My Personal Website: http://www.ashishmahajan.com
My Blogs: http://ashishmahajancrm.blogspot.com.au and http://ashishmahajancrm.wordpress.com
My Youtube Channel: http://www.youtube.com/user/ashishmahajanmscrm
My Twitter: https://twitter.com/#!/ashishmahajan74My Linkedin: 
- Proposed As Answer by Ashish Mahajan Australia (Architect) Sunday, April 01, 2012 12:13 AM
- Proposed As Answer by Ashish Mahajan Australia (Architect) Monday, April 02, 2012 1:42 PM
-
Sunday, April 01, 2012 1:09 AM
Hi,
We had the same requirements at one of our customer.
We solved the problem by creating a small aspx page that we deployed on the CRM server under another website.
Then we used an iFrame on the CRM Form to show this aspx page inside the desired entity Form.I don't have the source code of the aspx page anymore but you could get some hint on the following link.
http://www.microsofttranslator.com/BV.aspx?ref=CSSKB&lo=SS&from=en&to=fr&a=http://support.microsoft.com/kb/323246/en-us?fr=1Hope it helps.
Regards,
-
Sunday, April 01, 2012 8:53 AM
To upload a file from a browser you have basically two approaches.
Use an aspx form with a file input control. For this you will need to create a aspx page with a fileupload control. Here the user can select a file and upload it, in the aspx page you can decide what to do with the uploaded file. You can save it in CRM, on the disk or send it to another application. The aspx page should be hosted on a seperate website and can be included in a CRM Form using an IFrame.
The second approach requires the creation of a silverlight control. In this control you can request the user to select a file, this file can then be send to any server be it CRM or otherwise. Important to note is that as silverlight is running on the client you cannot post the file to a location other then same host which is running CRM, this is to prevent cross-site scripting.
Note that in both approaches the user must select the file them selves. Neither approach will allow you to specify the file to upload from javscript, again this is to prevent potential security issues.
Patrick Verbeeten
www.patrickverbeeten.com
www.wavextend.com- Proposed As Answer by danikahil Sunday, April 01, 2012 5:20 PM
-
Monday, April 02, 2012 2:13 PMHi,
If any of the responses answered your question and you are satisfied, please mark the response as an answer and vote as helpful. This will help others to search on similar problems.
Thanks in advance.Ashish Mahajan, CRM Developer, CSG (Melbourne)
My Personal Website: http://www.ashishmahajan.com
My Blogs: http://ashishmahajancrm.blogspot.com.au and http://ashishmahajancrm.wordpress.com
My Youtube Channel: http://www.youtube.com/user/ashishmahajanmscrm
My Twitter: https://twitter.com/#!/ashishmahajan74My Linkedin: 