Skip to content

Commit

Permalink
fix upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Gomez committed Jun 27, 2016
1 parent fbbebfe commit 5afdbb8
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions project/services/item.service.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ module.exports = function(app, models) {
}

function uploadImage(req, res) {
console.log("In upload")
console.log("In upload");

var itemId = req.body.itemId;
var myFile = req.file;
Expand All @@ -121,9 +121,6 @@ module.exports = function(app, models) {
var size = myFile.size;
var mimetype = myFile.mimetype;

if(!originalname)
res.status(401).send("No image added")
return;

newItem.image = "/uploads/"+filename;
newItem.seller = req.body.seller;
Expand Down
Binary file added public/uploads/2ee0109c795eed27a20fed632c37244c
Binary file not shown.
Binary file added public/uploads/a9b25b7e764df28b2577df2335330426
Binary file not shown.
Binary file added public/uploads/cd45e468d27c024ac6887c1fd88795db
Binary file not shown.
Binary file added public/uploads/d24315e48b93d17d38bb5d123c8ed991
Binary file not shown.
2 changes: 1 addition & 1 deletion public/views/item/item-new.view.client.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

<div class="form-group">
<form action="/api/upload" method="post" enctype="multipart/form-data">
<input name="myFile" type="file" class="form-control input-sm"/>
<input name="myFile" type="file" class="form-control input-sm" required/>
<button type="submit" class="btn btn-primary btn-block btn-sm">Upload Image</button>
<input name="seller" value="{{model.item.seller}}" style="display: none"/>
<input name="name" value="{{model.item.name}}" style="display: none"/>
Expand Down

0 comments on commit 5afdbb8

Please sign in to comment.