Skip to content

Commit a64f093

Browse files
committed
Merge pull request joni2back#126 from joni2back/click-changes
Multiple file support - API changes
2 parents fc3e87f + 7974391 commit a64f093

40 files changed

+2259
-737
lines changed

API.md

Lines changed: 78 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,55 @@
1-
## angular-filemanager API docs
1+
## angular-filemanager API docs [multiple file support]
22

33
#### Listing (URL: fileManagerConfig.listUrl, Method: POST)
44

55
**JSON Request content**
66
```json
7-
{ "params": {
8-
"mode": "list",
9-
"onlyFolders": false,
7+
{
8+
"action": "list",
109
"path": "/public_html"
11-
}}
10+
}
1211
```
1312
**JSON Response**
1413
```json
1514
{ "result": [
1615
{
17-
"name": "joomla",
18-
"rights": "drwxr-xr-x",
19-
"size": "4096",
20-
"date": "2015-04-29 09:04:24",
21-
"type": "dir"
22-
}, {
2316
"name": "magento",
2417
"rights": "drwxr-xr-x",
2518
"size": "4096",
26-
"date": "17:42",
19+
"date": "2016-03-03 15:31:40",
2720
"type": "dir"
2821
}, {
2922
"name": "index.php",
3023
"rights": "-rw-r--r--",
3124
"size": "549923",
32-
"date": "2013-11-01 11:44:13",
25+
"date": "2016-03-03 15:31:40",
3326
"type": "file"
3427
}
3528
]}
3629
```
3730
--------------------
38-
#### Rename / Move (URL: fileManagerConfig.renameUrl, Method: POST)
31+
#### Rename (URL: fileManagerConfig.renameUrl, Method: POST)
3932
**JSON Request content**
4033
```json
41-
{ "params": {
42-
"mode": "rename",
43-
"path": "/public_html/index.php",
44-
"newPath": "/public_html/index2.php"
45-
}}
34+
{
35+
"action": "rename",
36+
"item": "/public_html/index.php",
37+
"newItemPath": "/public_html/index2.php"
38+
}
39+
```
40+
**JSON Response**
41+
```json
42+
{ "result": { "success": true, "error": null } }
43+
```
44+
--------------------
45+
#### Move (URL: fileManagerConfig.moveUrl, Method: POST)
46+
**JSON Request content**
47+
```json
48+
{
49+
"action": "move",
50+
"items": ["/public_html/libs", "/public_html/config.php"],
51+
"newPath": "/public_html/includes"
52+
}
4653
```
4754
**JSON Response**
4855
```json
@@ -52,11 +59,11 @@
5259
#### Copy (URL: fileManagerConfig.copyUrl, Method: POST)
5360
**JSON Request content**
5461
```json
55-
{ "params": {
56-
"mode": "copy",
62+
{
63+
"action": "copy",
5764
"path": "/public_html/index.php",
5865
"newPath": "/public_html/index-copy.php"
59-
}}
66+
}
6067
```
6168
**JSON Response**
6269
```json
@@ -66,10 +73,10 @@
6673
#### Remove (URL: fileManagerConfig.removeUrl, Method: POST)
6774
**JSON Request content**
6875
```json
69-
{ "params": {
70-
"mode": "delete",
71-
"path": "/public_html/index.php",
72-
}}
76+
{
77+
"action": "remove",
78+
"items": ["/public_html/index.php"],
79+
}
7380
```
7481
**JSON Response**
7582
```json
@@ -79,11 +86,11 @@
7986
#### Edit file (URL: fileManagerConfig.editUrl, Method: POST)
8087
**JSON Request content**
8188
```json
82-
{ "params": {
83-
"mode": "savefile",
84-
"content": "<?php echo random(); ?>",
85-
"path": "/public_html/index.php",
86-
}}
89+
{
90+
"action": "edit",
91+
"item": "/public_html/index.php",
92+
"content": "<?php echo random(); ?>"
93+
}
8794
```
8895
**JSON Response**
8996
```json
@@ -93,10 +100,10 @@
93100
#### Get content of a file (URL: fileManagerConfig.getContentUrl, Method: POST)
94101
**JSON Request content**
95102
```json
96-
{ "params": {
97-
"mode": "editfile",
98-
"path": "/public_html/index.php"
99-
}}
103+
{
104+
"action": "getContent",
105+
"item": "/public_html/index.php"
106+
}
100107
```
101108
**JSON Response**
102109
```json
@@ -106,11 +113,10 @@
106113
#### Create folder (URL: fileManagerConfig.createFolderUrl, Method: POST)
107114
**JSON Request content**
108115
```json
109-
{ "params": {
110-
"mode": "addfolder",
111-
"name": "new-folder",
112-
"path": "/public_html"
113-
}}
116+
{
117+
"action": "createFolder",
118+
"newPath": "/public_html/new-folder"
119+
}
114120
```
115121
**JSON Response**
116122
```json
@@ -120,13 +126,13 @@
120126
#### Set permissions (URL: fileManagerConfig.permissionsUrl, Method: POST)
121127
**JSON Request content**
122128
```json
123-
{ "params": {
124-
"mode": "changepermissions",
125-
"path": "/public_html/index.php",
129+
{
130+
"action": "changePermissions",
131+
"items": ["/public_html/root", "/public_html/index.php"],
126132
"perms": "653",
127133
"permsCode": "rw-r-x-wx",
128-
"recursive": false
129-
}}
134+
"recursive": true
135+
}
130136
```
131137
**JSON Response**
132138
```json
@@ -136,10 +142,11 @@
136142
#### Compress file (URL: fileManagerConfig.compressUrl, Method: POST)
137143
**JSON Request content**
138144
```json
139-
{ "params": {
140-
"mode": "compress",
141-
"path": "/public_html/compressed.zip",
142-
"destination": "/public_html/backups"
145+
{
146+
"action": "compress",
147+
"items": ["/public_html/photos", "/public_html/docs"],
148+
"destination": "/public_html/backups",
149+
"compressedFilename": "random-files.zip"
143150
}}
144151
```
145152
**JSON Response**
@@ -150,12 +157,13 @@
150157
#### Extract file (URL: fileManagerConfig.extractUrl, Method: POST)
151158
**JSON Request content**
152159
```json
153-
{ "params": {
154-
"mode": "extract",
160+
{
161+
"action": "extract",
155162
"destination": "/public_html/extracted-files",
156-
"path": "/public_html/compressed.zip",
157-
"sourceFile": "/public_html/compressed.zip"
158-
}}
163+
"item": "/public_html/compressed.zip",
164+
"destination": "/public_html/extracteds/",
165+
"folderName": "latest"
166+
}
159167
```
160168
**JSON Response**
161169
```json
@@ -187,10 +195,24 @@ $destination = $_POST['destination'];
187195
$_FILES['file-0'] or foreach($_FILES)
188196
```
189197
--------------------
190-
#### Download / Preview file (URL: fileManagerConfig.downloadFileUrl, Method: GET)
198+
#### Download / Preview file (URL: fileManagerConfig.downloadMultipleUrl, Method: GET)
191199
**Http query params**
192200
```
193-
[fileManagerConfig.downloadFileUrl]?mode=download&preview=true&path=/public_html/image.jpg
201+
[fileManagerConfig.downloadFileUrl]?action=download&path=/public_html/image.jpg
202+
```
203+
**Response**
204+
```
205+
-File content
206+
```
207+
--------------------
208+
#### Download multiples files in ZIP/TAR (URL: fileManagerConfig.downloadFileUrl, Method: GET)
209+
**JSON Request content**
210+
```json
211+
{
212+
"action": "downloadMultiple",
213+
"items": ["/public_html/image1.jpg", "/public_html/image2.jpg"],
214+
"toFilename": "multiple-items.zip"
215+
}}
194216
```
195217
**Response**
196218
```

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,13 @@ A very smart filemanager to manage your files in the browser developed in Angula
44

55
[![Build Status](https://travis-ci.org/joni2back/angular-filemanager.svg?branch=master)](https://travis-ci.org/joni2back/angular-filemanager)
66

7-
#### I'm working on multiple file support / drag and drop features. API should be changed. For more information / contribute, see "[click-changes](https://github.com/joni2back/angular-filemanager/tree/click-changes)" branch.
8-
97
### Support
108
This project is under free license. If you want to support the angular-filemanager development or just thank it's main maintainer by paying a beer, you can make a donation by clicking the following button [![Donate](https://www.paypal.com/en_GB/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XRB7EW72PS982)
119

1210

1311
#### [Try the DEMO](http://angular-filemanager.zendelsolutions.com/)
1412
---------
15-
![](https://raw.githubusercontent.com/joni2back/angular-filemanager/master/screenshot1.png)
16-
![](https://raw.githubusercontent.com/joni2back/angular-filemanager/master/screenshot2.png)
17-
![](https://raw.githubusercontent.com/joni2back/angular-filemanager/master/screenshot3.png)
13+
![](https://raw.githubusercontent.com/joni2back/angular-filemanager/click-changes/screenshot.gif)
1814

1915
### Features
2016
- Multilanguage (English / Spanish / Portuguese / French / German)
@@ -74,8 +70,9 @@ This project is under free license. If you want to support the angular-filemanag
7470
<script src="src/js/providers/config.js"></script>
7571
<script src="src/js/entities/chmod.js"></script>
7672
<script src="src/js/entities/item.js"></script>
73+
<script src="src/js/services/apihandler.js"></script>
74+
<script src="src/js/services/apimiddleware.js"></script>
7775
<script src="src/js/services/filenavigator.js"></script>
78-
<script src="src/js/services/fileuploader.js"></script>
7976
<script src="src/js/providers/translations.js"></script>
8077
<script src="src/js/controllers/main.js"></script>
8178
<script src="src/js/controllers/selector-controller.js"></script>

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-filemanager",
3-
"version": "1.4.8",
3+
"version": "1.5.0",
44
"homepage": "https://github.com/joni2back/angular-filemanager",
55
"authors": [
66
"Jonas Sciangula Street <[email protected]>"

0 commit comments

Comments
 (0)