save a pdf file and an image in an angular path

0

I'm new at angular not to say I do not know anything. The files are on a server and I need to specify a pdf file and an image to use them in my view, is it possible?

    
asked by Marco 01.11.2018 в 18:27
source

1 answer

0

Ok, I think I have understood your question, but it is still broad because there is no intention or content that helps to give a much clearer concept of your problem.

Things you should keep in mind:

  • The files should never be stored in our database, because exactly what you are saying happens (it becomes slow and you might lose in terms of user experience)
  • So what do I do? You must divide your problem in two, I do not know if you are using a server programming language, which is recommended, be it PHP, NODEJS, PYTHON, etc.
  • This way you can do at the moment you are going to create a new product with the corresponding data of the product in a form, you add an input <input type="file" name="" value=""> for the PDF file and another one for the IMAGE file.
  • Then, you get the temporary route and move it to a root of your project. So when you get that address you can store it in your Database.
  • Already having that address you should only refer to it from the view.
  • If you want something more specific you have to give more information about your doubt (although I think you should already know this), for example the structure of your table, which languages you are using from Angular, if you have code that helps would be the most advisable, etc.

        
    answered by 01.11.2018 в 21:38