'db'=>array( 'connectionString' => 'mysql:host=localhost;dbname=mediabox', 'emulatePrepare' => true, 'username' => 'mediabox', 'password' => 'mediabox', 'charset' => 'utf8', ),
cd mediabox-storage/silex/ php composer.phar install
URL | Request | Answer | Description |
/ fm / fs / | $ _GET ["id"] | Json { text: ..., id: ..., hasChildren: [true or false], spriteCssClass: "[folder]" } | Gets the directory structure for treeview |
/ fm / chdir / | $ _GET ["id"] | * File JSON Object | Gets a list of files in the current directory |
/ fm / upload / | $ _GET ["file"] $ _GET ["size"] $ _GET ["extension"] | * File JSON Object | Adds a new file to the database |
/ fm / thumb / [FILE_ID] / | $ _POST ["data"] | Saves a preview if the uploaded file is an image. | |
/ fm / getThumb / | $ _GET ["name"], where name = file_id | Content-Type: image / png Binary data | Gets a preview |
/ fm / copy / | $ _POST ["file"] (mb several) $ _POST ["folder"] (several MB) | Saves in session a list of files to copy. | |
/ fm / restore / | $ _POST ["file"] (mb several) $ _POST ["folder"] (several MB) | Recover files from recycle bin | |
/ fm / getTypesNum / | $ _GET ["id"] | Json { all => [total files], image => [number of image files], video => [number of video files], audio => [number of audio files], other => [number of other files], path => [HTML STRING] } | Gets the number of files by type and HTML string of the current path in FS |
/ fm / create / | $ _GET ["name"] | ** Folder JSON Object | Create a folder |
/ fm / getTrash / | $ _GET ["id"] (many) | * File JSON Object | Get the list of files in the basket |
/ fm / fileToTrash / | $ _GET ["id"] (many) | Move file to recycle bin | |
/ fm / folderToTrash / | $ _GET ["id"] (many) | Move directory to trash | |
/ fm / remove / | $ _GET ["id"] | Delete file from database and storage | |
/ fm / rmFolder / | $ _GET ["id"] | Remove directory from DB and storage | |
/ fm / removeFileByName / | $ _GET ["name"] | PLAIN TEXT return file_id | Delete the file from the database in the current directory by name (needed to cancel the current download) |
/ fm / buffer / | * File JSON Object | Get a list of files in the buffer (for copying) | |
/ fm / past / | Moves files from session to current directory | ||
/ fm / deleteFileFromBuffer / | $ _GET ["id"] | * File JSON Object | Delete file from clipboard (for copying) |
/ fm / clearBuffer / | Clear buffer (copy) | ||
/ fm / sort / | $ _GET ["type"] | Apply file sorting | |
/ fm / view / | $ _GET [«view»] | Apply file display mode | |
/ fm / types / | $ _GET ["other"] $ _GET ["image"] $ _GET ["video"] $ _GET ["music"] | Save the list - which file types to display and which not |
{ id: …, name: …, shortname: …, obj: file”, type: [video,audio,…], mimetype: …, size: …, date: …, ico: …, src: …, ext: …, }
{ Id: …, name: …, shortname: …, obj: "folder", date: …, size: …, ico: …, parent: [ID ] }
URL | Request | Answer | Description |
/ audio / saveList / | $ _POST ["track"] (many) | Save track in current playlist | |
/ audio / createList / | $ _GET ["name"] | Create New Playlist | |
/ audio / showList / | Json { Id: ..., name: ... } | Get a list of playlists | |
/ audio / getTracksList / | Json { Id: ..., name: ... } | Current tracks in the default playlist | |
/ audio / setPlaylist / | $ _GET ["playlist-id"] | Make playlist current | |
/ audio / deletePlaylist / | $ _GET ["playlist-id"] | Delete playlist | |
/ audio / volume / | $ _GET ["level"] | Change volume |
URL | Request | Answer | Description |
/ image / setCrop / | $ _GET ["_ id"] $ _GET ["desc"] $ _GET ["ws"] $ _GET ["x1"] $ _GET ["x2"] $ _GET ["y1"] $ _GET ["y2"] | Save tag to photo | |
/ image / addTag / | $ _GET ["_ id"] $ _GET ["tag"] | Add a tag | |
/ image / getCrops / | $ _GET ["id"] | Json { x1: ..., x2: ..., y1: ..., y2: ..., ws: [image height when ticking], description: ..., } | Get tagging (coordinates and text) for the image |
/ image / getTags / | $ _GET ["id"] | Json { tag: ... } | Get tags for image |
/ image / addComment / | $ _GET ["id"] $ _GET ["text"] | Add a comment | |
/ image / getComments / | $ _GET ["id"] | Json { text: ..., user: ..., timestamp: ..., } | Get comments for the image |
/ image / getAllTags / | Json { tag, tag, ... } | Get a list of all tags | |
/ image / getAllCrops / | Json { label name, label name, ... } | Get a list of all notes | |
/ image / selTag / | $ _GET ["tag"] | Select tag - returns a list of tags and labels for current images. | |
/ image / selCrop / | $ _GET ["crop"] | Select a tag - returns a list of tags and labels for current images | |
/ image / getFsImg / | * File JSON Object: { id: ..., name: ..., shortname: ..., obj: file ”, type: [video, audio, ...], mimetype: ..., size: ..., date: ..., ico: ..., src: ..., ext: ..., } | Get a list of images that satisfy the selected tags and tags. |
URL | Request | Answer | Description |
/ save / | $ _POST ["id"] $ _POST ["name"] + file | Save file | |
/ get / | $ _GET ["id"] | File streaming | Get file |
/ remove / | $ _GET ["id"] | Delete a file |
Source: https://habr.com/ru/post/221737/
All Articles