File upload and download - Angular with Node - angularjs

I am working on project where I have to store a file/img/pdf for a particular user instance and retrieve the files when the user logged in.
So the theme is, whenever user uploads a file it should be populated in his screen like profile pictures, invoice PDF's etc.,
Moreover, I just want to perform a carousel slideshow of uploaded images by user.
I came through several baked in modules such as ng-file-upload in angular and I was successful in uploading files too but how can I retrieve the particular file from the server and display them to user?
What is the best practice to achieve this?
Thanks in advance!

Related

React file upload without using node - possible?

Is it possible to have a file upload work in React only without Node? I say this because every single article I read, node is involved. All I want to do is for a user to be able to upload a picture to my react app (filling in a simple form), and when they submit that form, a new post is created along with the picture they uploaded. I don't need the post to persist, this is frontend only. Is it possible to do this without node?
You can make this to work but you will need AWS or other Image upload services like Cloudinary.
You can create an account with AWS, create a bucket and use their SDK to push the image to them and they will return a URL.
Checkout this article though: https://javascript.plainenglish.io/how-to-upload-files-to-aws-s3-in-react-591e533d615e

Store an image in local application folder in AngularJS

In my AngularJS application I need to store the images that a user choose from his device, in the application folder.
Only the device used to choose the image has to see it.
So I will save in the backend only the path of this image.
I tried to search how to move or copy an image in a folder, but I haven't found any solution.
How should I do this?

Downloading files from URL

I have a question related to a security on website. Lets say that a visitor is currently on a http://www.example.com/. And visitor navigates to gallery page. There he can find unique images that are displayed to him according to his log in details he provided earlier. A simple inspect on a picture shows him the URL to that picture: www.example.com/images/image_589326.png.
My question is: Is there a way for a user to somehow download all the files from
www.example.com/images/ folder, or somehow find the names of all images that are in that folder and simply view them with absolute URL.
Yes, that is possible. There are two main ways that this can be achieved: scraping & enumeration.
Through scraping someone would make a script that would look at the gallery page and make a list of all of the images, and then download them all.
Enumeration would just request http://www.example.com/images/image_000001.png through http://www.example.com/images/image_999999.png and download of the images that are present.
If the site is not proprely set up you may also be able to get a directory listing from http://www.example.com/images to see all of the files in the images/ directory.

serving pictures from database using nodejs

I am working on a web app and I want to serve users some of their own pictures that I will have stored in a database. I have a profile page view were I have some jade template. I want to load the users pictures when they click on their profile but I do not know where to start with that (I am relatively new to node). I have tried using google but no useful answers have come up. How can I load the user specific pictures from a database using nodeJS?
Any help is appreciated, thank you.
Never store image into db. It's wrong. Store path, url or other, but not Image Binary.
Retrieve url that you have stored into db and put them into your final html.
M.

How to auto generate a webpage after user submits form

I am looking for some initial direction on this one because I cannot seem to find my way with it. Let me explain...
I am developing a website wherein a logged in site member (Joomla 1.6) can fill out a simple form and attach a pdf to be uploaded upon submission. The user then clicks the submit button and the page will refresh to a new and unique web page.
User Submits data on http://www.examplesite.com and then after submission a new web page is generated that is called http://www.examplesite.com/userSubmittedValue
This newly generated web page would come from a template that is specified by the administrator and, most important, it will display all of the information that the user submitted. Also, there would be a link to download the pdf they uploaded. The user could then view a list of all the pages they have created in this manner via their profile.
I have seen this all over, but I am at a loss for how to generate this. Any help is much appreciated.
This is not something you will be able to easily do or get a detailed answer for here. If you just wanted to do the submission form with a thank you page that shows the data submitted you could use any number of form wizard type extensions - http://extensions.joomla.org/extensions/contacts-and-feedback/forms
If you just needed a way for users to upload PDfs and have access to them you could use one of the file management extensions that offer front end upload features - http://extensions.joomla.org/extensions/directory-a-documentation/downloads
If the additional data that is being submitted is simply data related to the file - title, description, etc then one of the file download components should work fine for you. The choices are limited in 1.6 at this time though so you might have to go with 1.5 to get the extension that works best for your needs.
So this probably isn't the best way to do it if your using Joomla but it just might help.
I would use PHP and inside of you're directory have a file like "template.html". Then I would create some php to handle the task of....
Opening "template.html"
Finding and replacing the values that the user passed you
Save the "template.html" under a new name (userSubmittedValue.html)
Again, I never really use Joomla. If you were to try this I'd suggest checking out php's file system functions (http://us2.php.net/manual/en/ref.filesystem.php).
Hope this helps a bit.

Resources