Is there a possibility to list files from a directory on the webserver? It is not a media folder or an umbraco folder, just a folder on the same server as the umbraco - Installation which I have created via FTP with Webcam-Pictures in it.
I want to list the files from the folder via c# in a partial view!
It should be possible, there are several options available to you. Saying that you just need to consider permissions. If the account that the website is running as, doesn't have access then you wouldn't be able to do it directly I don't think.
This returns a string array for each of the files found and then you can do whatever you need to with. You can also pass in a wildcard if you'd like to only get certain files.
Get Files from Directory
Hello Everybody!
Is there a possibility to list files from a directory on the webserver? It is not a media folder or an umbraco folder, just a folder on the same server as the umbraco - Installation which I have created via FTP with Webcam-Pictures in it.
I want to list the files from the folder via c# in a partial view!
Thanks, Christoph
It should be possible, there are several options available to you. Saying that you just need to consider permissions. If the account that the website is running as, doesn't have access then you wouldn't be able to do it directly I don't think.
Not really Umbraco specific one but you'll be able to do this using Directory.GetFiles (https://msdn.microsoft.com/en-us/library/07wt70x2(v=vs.110).aspx)
This returns a string array for each of the files found and then you can do whatever you need to with. You can also pass in a wildcard if you'd like to only get certain files.
As Nik said, important to get permissions right
Perfect! Thank you!
I have solved it that way in a Partial View:
You could also use the cropping functionality in http://imageprocessor.org/ for your images thats built into Umbraco.
Not 100% sure if it works with images outside of the Umbraco media library but think it does....?
is working on a reply...