Implementing ng2-file-upload #236

Open
opened 2016-06-04 00:43:03 +00:00 by andlcool · 1 comment
andlcool commented 2016-06-04 00:43:03 +00:00 (Migrated from github.com)

Hi there,

I am trying to explore trying to use ng2-file-upload but having some trouble understanding how to implement it as the readme is quite sparse. Are there anymore details that can help me get started on this. I am trying to create a demo app to upload images and save them in the server as a start.

I checked out the demo page here, http://valor-software.com/ng2-file-upload/

A few questions if anyone can help.

  1. For the typescript page, const URL refers to an API and in the example, it is 'https://evening-anchorage-3159.herokuapp.com/api/'.
  2. There is a file-catcher.js file in the demo/component/file-upload directory. Can anyone explain what this does and whether it is needed? Seems like an express app.

Or any other way to implement an image upload function is also welcomed. Thanks.

Hi there, I am trying to explore trying to use ng2-file-upload but having some trouble understanding how to implement it as the readme is quite sparse. Are there anymore details that can help me get started on this. I am trying to create a demo app to upload images and save them in the server as a start. I checked out the demo page here, http://valor-software.com/ng2-file-upload/ A few questions if anyone can help. 1. For the typescript page, const URL refers to an API and in the example, it is 'https://evening-anchorage-3159.herokuapp.com/api/'. 2. There is a file-catcher.js file in the demo/component/file-upload directory. Can anyone explain what this does and whether it is needed? Seems like an express app. Or any other way to implement an image upload function is also welcomed. Thanks.
t246246 commented 2016-06-06 02:23:34 +00:00 (Migrated from github.com)

Just rewrite URL in simple-demo.ts to const URL = 'http://localhost:3000/api/'; and run demo server with command node file-catcher.js. Then you can see four file was uploaded at uploads (that are defined as var DIR = './uploads/'; in file-catcher.js.

But as file-catcher.js is supposed to use older multer, you have to rewrite it to newer syntax if you will use current multer.

Just rewrite URL in simple-demo.ts to `const URL = 'http://localhost:3000/api/';` and run demo server with command `node file-catcher.js`. Then you can see four file was uploaded at uploads (that are defined as `var DIR = './uploads/';` in file-catcher.js. But as file-catcher.js is supposed to use older multer, you have to rewrite it to newer syntax if you will use current multer.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#236