upload - Salesforce - Is it possible to display image file from ContentVersion to custom visualforce page? -
I wrote a simple visualfold page that the user should upload the file to an Now I want to display the saved image in my custom view panel page. Is this possible? It looks like The real problem is that I successfully uploaded the image file but what is its URL? I have tested it out on Google with random URLs and I can display the image (like /../..some.jpg "). But I do not know what is the full URL for the image file that was uploaded. Contentversion. Note: This is not a static resource because my users can change their user image often. Code Public image utilizer controller with Vijhualfors page I think it is currently not possible to serve it with content The format provided by ScottW works for documents. The second option I have made is to upload a zip file containing my images to stable resources. Which can then be referred to. ContentVersion Object.
& lt; Apex: image & gt; can not be used
& lt; Img href = "{! Cv.contentVersion}" ... ... & gt; There was no luck.
shared code {public Lab file {get; set;} public string image file path {get; set;} public content server cv {get; set;} public image uploadtist controller () {cv = [selection id, version data, title, pathOnClient contentVersion limit1];} // fill in the input file field and press and it will upload the file to the server. Page reference () {contentVersion v = new ContentVersion (); v.versionData = file; v.title = 'some title'; v.pathOnClient = '/ Foo.jpeg '; insert v; come back new page reference (' / '+ v.id);} //v.id sample // 06 9 one 20000000 9 unx 3} // E Class
& lt; Top: Page Controller = "Image utilizer controller" & gt; & Lt; Top: Forms & gt; & Lt; Top: inputfile value = "{!!}" / & gt; & Lt; Apex: commandbutton action = "{! Go}" value = "go" /> & Lt; / Supreme: Forms & gt; & Lt ;! - None of the tasks given below !! :( -> -> a href = "/ {! Cv.id}" & gt; {! Cv.title} {! Cv.pathOnClient} & lt; / a & gt; & lt; a href = "Https: // no 7 .salesforce.com / 069A00000009FG4"> & lt; apex: image value = "/ 069A00000009Ux3" width = "220" height = "55" /> ; & Lt; / top: page & gt;
Comments
Post a Comment