You need to sign in to do that
Don't have an account?
File..path
Hi All,
Say there's a custom button called 'File Info' in a custom object A.
Once clicked, it opens up a browser window.
From there, a user will choose a file.
When user clicks 'Select' button in that browser window, a new record will be created with the File Name and File Location in the custom object A. And the file is stored in a local network drive.
I don't think it is possible at all in Salesforce. But I would really appreciate your insights and experiences.
We can definitely create a button to open up a browser window and select the file...
But once the user selects the file, how can we ever display it's path..in local network drive??
Merci Beaucoup
This link here has a solution to fetch file and file path using Java...
http://stackoverflow.com/questions/7991294/fetching-file-and-path-from-network-using-java
But I have no clue if this could be implemented in salesforce to actually create a record consisting of file name and file path in two different fields...
Any thoughts dear people?
alliswell, you can't create a local file directly with just Visualforce and Apex. You would have to have a web service on you end that we can call out to that would create the file locally.
Thanks for the insights Ryan :)
But the requirements I have is:
- Let the user browse and select the file(the file is stored in local network drive) through browser window.
- Populate the path and name of the file.(Not the actual file itself)
Any other insights??
Thanks for your time!!!
You could follow it right up to the point of actually assigning the file I
believe. If I understand what you are trying to do correctly:
http://developer.force.com/cookbook/recipe/uploading-a-document-using-visualforce-and-a-custom-controller
Ryan,
Thank you once again for your time! However, I still need some guidance...
That was pretty awesome. Thanks for the link :)
It does allow me to browse local network( e.g. \\network\salesforce.\documents\)
However, once the user selects the file, how can we populate the PATH(For example- \\network\salesforce\documents\file.doc) of the file?
Say, I don't need to upload the file itself...but all I need by clicking a file in local network, is it's name and path and populate these info as a record.
Can we do it?
Thank you!!
For further details about integrating VF with FLEX have a look here http://blogs.developerforce.com/developer-relations/2009/09/integrating_flex_into_visualforce_pages.html
Here's the code that will get you the file name and store it to an object's field. For this example I've created a custom object called DocInfo with a custom field called DocName. You have to look here http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_inputFile.htm on your own to see if you can use the foundation I've supplied to figure out a way to get the path. I'm not sure you can but perhaps you'll figure it out.
Controller:
Page:
Thank you Avidev9! Will certainly use the info on my way to the solution!
Thank you for your time and guidance Ryan!
Will start working towards writing a solution soon. Hopefully will be back with some workarounds :)
Thank you once again!
Awesome. Please do the community a favor and post back what you ended up doing. It's great for future reference.
So far it doesn't look feasible to do it through Apex/VF...
<apex:inputfile> has fileName and fileSize attribute but not filePath
Asked other experts on their opinion...and seems like it is not possible/feasible get file path..
@sfdcfox kindly provided me some direction....using Java to build an applet and integrate onto the Salesforce...
There are methods in Java like getpath(), getabsolutepath() and I was thinking if I can look into the source code and may be replicate the process..but the concept got really complicated before I started....
Any thoughts Ryan?
Thanks!!