F diff --git a/loggedin.js b/loggedin.js
--- a/loggedin.js
+++ b/loggedin.js
the_file.onchange = on_file_added;
- var files = [];
-
- const pwd = "/";
+ const files = [];
const pending_uploads = [];
}
- function load_dir(pwd) {
- var data = new FormData();
- data.append('path', '/');
-
- var xhr = new XMLHttpRequest();
- xhr.open('POST', '/php/readdir.php', true);
- xhr.onload = function () {
- for (const f of files)
- f[1].remove();
- files = [];
-
- var json = JSON.parse(this.responseText);
- for (const f of json) {
- add_file_visuals(f.name, f.mimetype);
- }
- };
- xhr.send(data);
- }
-
- function add_file_visuals(name, mimetype) {
+ function add_file_visuals(name, pending) {
var fileDiv = document.createElement('div');
var img = document.createElement('img');
function begin_upload() {
the_file.click();
}
-
- load_dir("/");
F diff --git a/php/node.php b/php/node.php
--- a/php/node.php
+++ b/php/node.php
$this->node_id=$node_id;
}
}
-
- class Current_Directory extends Node
+ class Directory_Node extends Node
{
- /*an array of the dir_ids taken to reach here*/
- public $path;
-
- function __construct($user_id)
- {
- $this->dir_id=get_home_id($user_id);
- $this->path=[$dir_id];
- }
- function change_directory($directory_id):bool
+ public $node_list;
+ /*the path in terms of the simulated filesystem*/
+ function __construct(string $abstract_path)
{
- global $database;
- if(!$database->is_directory($directory_id))
- {
- return false;
- }
-
}
}
F diff --git a/php/readdir.php b/php/readdir.php
--- a/php/readdir.php
+++ b/php/readdir.php
- <?php
- echo '[ { "name": "file1.txt", "mimetype": "text/plain", "is_directory": false }, { "name": "file2.pdf", "mimetype": "application/pdf", "is_directory": false }, { "name": "dir", "mimetype": "", "is_directory": true } ] ';
- ?>
F diff --git a/php/upload.php b/php/upload.php
--- a/php/upload.php
+++ b/php/upload.php
exit(1);
}
+ echo "adsf";
+
$file = $_FILES["the_file"];
$filename= $_POST["filename"];
F diff --git a/sql/fileshare.sql b/sql/fileshare.sql
--- a/sql/fileshare.sql
+++ b/sql/fileshare.sql
/*BEWARE!*/
- drop table if exists node_access;
drop table if exists users;
- drop table if exists node_links;
drop table if exists nodes;
+ drop table if exists node_access;
+ drop table if exists node_links;