Commit Graph

84 Commits

Author SHA1 Message Date
Julian Lam
c043cfebd6 fix: added back missing topic thumb tests that were removed in last commit 2020-12-09 10:42:41 -05:00
Julian Lam
340387c18a fix: #9055, non-standard API response from addThumbs route
Also removed old thumb upload router handler, and updated uploadPost handling in composer to match new response schema
2020-12-09 10:42:41 -05:00
Julian Lam
5950683316 feat: closes #9048, tests for topic thumbs routes, write API schema 2020-12-09 10:42:41 -05:00
Julian Lam
98cd9e3549 feat: allow uploadThumb controller to be called in code
it, and uploadsController.upload() now return the results of their operation
2020-12-09 10:42:41 -05:00
Barış Soner Uşaklı
9ee1fb490e fix: https://github.com/NodeBB/NodeBB/pull/8759 2020-11-23 11:18:42 -05:00
Julian Lam
6e2da9966e refactor: move plugin hook methods to plugin.hooks.* 2020-11-20 16:32:39 -05:00
Peter Jaszkowiak
55d5cccf2e Document deprecations and remove old ones (#8706)
* chore: document deprecation removal versions

* chore: remove deprecations 2+ versions old
2020-10-01 12:25:03 -04:00
Barış Soner Uşaklı
37e56d94ce feat: series upload 2020-07-27 11:46:14 -04:00
Barış Soner Uşaklı
7f24200c73 feat: add folder to filter:uploadImage and filter:uploadFile 2020-05-22 10:00:24 -04:00
Julian Lam
6f504c4142 Remove allowFileUploads ACP option (#8324)
* feat: allow awaitable upgrade scripts

* feat: allowFileUploads removal upgrade script

* refactor: remove unnecessary ACP option `allowFileUploads`

* fix: updated upgrade script template to not use callback arg

* fix: upgrade script as per @baris

* fix: add missing await

* fix: add missing await
2020-05-21 16:06:35 -04:00
Barış Soner Uşaklı
ffe3670ff5 feat: deprecate file.isFileTypeAllowed
use image.isFileTypeAllowed, this function was always meant for images
2019-09-29 19:53:03 -04:00
Barış Soner Uşaklı
5c0266d8c4 refactor: async/await uploads 2019-09-12 12:41:59 -04:00
Barış Soner Uşaklı
5eaa14e746 fix: strip exif data on image uploads 2019-03-06 16:36:02 -05:00
Barış Soner Uşaklı
7e828404f6 fix: #7116
dont save relative_path in db for group covers
2018-12-18 19:43:28 -05:00
Barış Soner Uşaklı
9c03881d5a add threshold for image resizing 2018-10-24 20:03:03 -04:00
Barış Soner Uşaklı
9c022afae1 Parse int (#6853)
* Store config fields as JSON in the db

Fewer parseInts

* Remove unnecessary parseInts

* remove some dupe code add tests

* remove console.log

* remove more parseInts

* WIP: read meta.configs defaults from defaults.json

remove more parseInts

* more work

* add log for failing test

* update admin pwd

* fix tests, dont require posts/cache before configs are initialized

* handle saves

* Test boolean conditions

* remove more parseInts

* Fix boolean values

* remove lots more parseInts

* removed json parsing

* renamed var to number

* categories dont have timestamp
2018-10-21 16:47:51 -04:00
Barış Soner Uşaklı
26d4e0852f use includes instead of indexOf
use _.uniq instead of filter&indexOf
2018-10-20 14:40:48 -04:00
Barış Soner Uşaklı
59b988a205 change test so it checks url 2018-09-20 22:09:20 -04:00
Barış Soner Uşaklı
b7ead6dc9c Replace jimp with sharp (#6774)
* add probe image size and max image size

* replace jimp and image-probe with sharp

* better name for test

* resize with just path

* resize thumb inplace

* use filename
2018-09-20 17:05:52 -04:00
Julian Lam
d1fd07f42f remove console.log, #6486 2018-05-08 16:19:33 -04:00
Julian Lam
18bde866ff Append file name to the JSON payload returned
... during file upload process... closes #6486
2018-05-08 16:18:28 -04:00
Barış Soner Uşaklı
5d2a7106f6 change upload storage 2018-04-12 12:35:05 -04:00
Barış Soner Uşaklı
04979f86a8 delete users uploads on account delete
store uid:<uid>:uploads
2018-04-06 15:16:28 -04:00
Barış Soner Uşaklı
dcb6af5768 closes #6373 2018-03-19 16:24:22 -04:00
Baris Usakli
1c24c34d04 add missing comma 2018-02-26 16:05:12 -05:00
Baris Usakli
d25eb674c6 make climate happy 2018-02-26 15:54:17 -05:00
Julian Lam
a8ec6a4a9c patching accidental leakage of full path of uploaded file when uploading pictures or attachments 2018-02-26 15:40:19 -05:00
Barış Soner Uşaklı
ff6c6a54c1 make upload permissions global
give upload image permission to registered users on install
add global privileges to app.user.privileges for client side use
2018-01-03 13:27:34 -05:00
Barış Soner Uşaklı
6a2019c646 closes #6003 2017-10-23 19:05:00 -04:00
Barış Soner Uşaklı
eecc680761 style 2017-07-17 18:16:23 -04:00
dbolack-ab
c1452db0ba Adds the filter:uploadStored hook which fires after the file is saved… (#5798)
* Adds the filter:uploadStored hook which fires after the file is saved in the async waterfall and passes:
                       var storedFile = {
                       url: nconf.get('relative_path') + upload.url,
                       path: upload.path,
                       name: uploadedFile.name,
               }
               plugins.fireHook( 'filter:uploadStored', { uploadedFile: uploadedFile, storedFile: storedFile } );

* Corrections per PR. Should match style guide.

* Correction attempts take 2.

Per:

/home/travis/build/NodeBB/NodeBB/src/controllers/uploads.js

  234:5    error  Missing semicolon                            semi

  235:3    error  Expected indentation of 3 tabs but found 2   indent

  235:19   error  There should be no spaces inside this paren  space-in-parens

  235:105  error  There should be no spaces inside this paren  space-in-parens

  236:3    error  Expected indentation of 3 tabs but found 2   indent

* next() shouldn't fire twice, but I see no documentation suggesting that the paramaters will fire correctly.

Previous comments imply it is preferred to have fireHook fire fof the callback rather than having it happen next,  so I'm wrapping next in an anonymous function to ensure it passes the parameters.

If this is not the preferred method, please provide a thorough correction.

* Meh. Figuring out this style requirement is so hit and miss.

* Corrected for proper callback? technique.

Might blow up on style. Will watch.
2017-07-17 18:15:24 -04:00
Ben Lubar
07982a3fa2 Fix uploading a file with no extension resulting in invalid-extension even if the file extension list is blank (allow all) 2017-06-16 10:37:23 -05:00
Barış Soner Uşaklı
c9d502320f file.delete method 2017-05-24 00:02:30 -04:00
Ben Lubar
572d7a1e8c Fix uploads of files with no extension failing when there is no restriction on file extensions. 2017-05-11 11:25:13 -05:00
Barış Soner Uşaklı
13a04123e0 closes #5641 2017-05-01 20:58:34 -04:00
barisusakli
e63559b6fd closes #5484 2017-04-14 12:59:36 -04:00
barisusakli
b7e6104bbc closes #5511 2017-03-07 15:59:50 +03:00
barisusakli
bce1208e2f make uploadFile public 2017-03-02 20:51:03 +03:00
Julian Lam
e71bd7a27f Merge branch 'master' into styleguide 2017-02-24 11:45:04 -05:00
barisusakli
04b07e292c thumb tests 2017-02-24 17:34:34 +03:00
Peter Jaszkowiak
23540afaeb Resolve merge conflicts 2017-02-18 19:14:39 -07:00
Peter Jaszkowiak
896c8c7343 ESlint object-curly-spacing 2017-02-18 12:30:49 -07:00
Peter Jaszkowiak
3b0dd2d1ef ESlint padded-blocks 2017-02-18 02:32:24 -07:00
Peter Jaszkowiak
a038c66549 ESlint quotes 2017-02-18 01:56:23 -07:00
Peter Jaszkowiak
52f2028206 ESlint no-multiple-empty-lines 2017-02-17 22:08:23 -07:00
Peter Jaszkowiak
bc1d70c126 ESlint comma-dangle 2017-02-17 19:31:21 -07:00
pichalite
7f4e4c8e2e Fix styling 2017-02-17 20:02:26 +00:00
pichalite
4d755bad0c Use typeToExtension from file.js 2017-02-17 19:57:18 +00:00
barisusakli
51981ffb99 get extention from content type 2017-01-31 22:18:22 +03:00
Anil Mandepudi
619ca48403 remove shims for IE8 (#5157) 2016-10-26 14:36:26 -04:00