Search code examples
asp.net-coreinputrazorbootstrap-5

Is it possible to set folder path for input type IFormFile


I am currently working on a CMS web application. To select images i am using the following code. The input type is IFormFile(BigImage is of type IFormFile)

<div class="input-group input-group-sm mb-2 custom-file-button">
 <label class="input-group-text" for="inputGroupFile">GroßesBild</label>
 <input class="form-control" form="addUpdateSubmenu" asp-for="BigImage" id="inputGroupFile">
</div>

Now my question is if it is possible to set a default folder path like: "\abc33\images\bilder" Now it is just opening any folder which was used the latest.

So if i would select an image the directory would look like shown on this screenshot


Solution

  • There is no concept of folder selection in the HTML/JavaScript platform. Even if you could select one, you wouldn't be able to do anything with the folder path. Web applications do not have access to a client's file system.

    Here is a similar issue, You can refer to it.