locked
How to retrieve files URLs and display into the page?? RRS feed

  • Question

  • User-1797368610 posted

    Hi All,

    I have an external facing web application which residing into Cloud web server for external users where they will upload excel/pdf files in the network location. i dont want let them directly access to network location rather will prefer access from aspx page. so basically trying to create a page where specific user see only urls which is uploaded by him and by clicking the link it will open the file. any idea how to achieve this?

    Thanks in Advanced 

    Friday, October 9, 2020 2:28 PM

All replies

  • User475983607 posted

    Typically, the uploaded files are stored outside the hosted application and a Web API Action (this is a Web API support forum) returns the file.  The Web API action can be secured so only authenticated user can access the Action.  Furthermore, you can restrict access by role. claim, username, or whatever you like using standard security in Web API.

    The same concept applies to Web Forms and MVC if you posted in the wrong forum.

    Friday, October 9, 2020 2:41 PM
  • User-1797368610 posted

    Hi,

    Thanks for your reply. Yes, you right. we are thinking to store uploaded files outside the hosted application. So basically we are using Web forms application for user interaction where they will upload files (excel/pdf). And we are trying to have final destination could be Web Api project. once file is saved then display files into web forms based on user creation. any reference would be great.

    Friday, October 9, 2020 4:22 PM
  • User475983607 posted

    Thanks for your reply. Yes, you right. we are thinking to store uploaded files outside the hosted application. So basically we are using Web forms application for user interaction where they will upload files (excel/pdf). And we are trying to have final destination could be Web Api project. once file is saved then display files into web forms based on user creation. any reference would be great.

    Your response is very confusing.  If the users uploads files using Web Forms, what roles does Web API perform?  

    Friday, October 9, 2020 4:35 PM
  • User438705957 posted

    Not entirely sure I'm on the right track with your issue.
    I have an app that allows users to upload files to a share on our network.
    We use an input element of type 'file' to upload the file and a click event to send the file as form data to a controller method on the server.

    In the controller method, we first perform a copy of the file to a folder under the website's root folder, and from there copy it to the network share location. We send URI parameters to the controller method, informing the copy operations the network location the file should be copied to.

    We send the file path of the file with the response, to update the d/b with that info.

    On display, for records with a document loaded, we set it to a file icon.
    On clicking the icon, it loads an aspx file in a separate tab which creates a Response object with the file content.

    I'm sure you know by now that Chrome and EDGE no longer permit the client side file protocol opening a file.

    Tuesday, October 20, 2020 11:33 PM