Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
316b265
estructura basica
IuliiaNova Jan 9, 2023
d4b3966
admin css and php error messages
valentraverso Jan 10, 2023
f9aa953
create folder
IuliiaNova Jan 10, 2023
fb98d58
error commit
valentraverso Jan 10, 2023
2788664
modify, delete folders
IuliiaNova Jan 10, 2023
904c867
show folder´s content
IuliiaNova Jan 10, 2023
98e8575
upload, display folder + content of folder
IuliiaNova Jan 10, 2023
2d6fbfc
display info selector
IuliiaNova Jan 10, 2023
4f1efd7
show content img, video, audio, txt
IuliiaNova Jan 11, 2023
5c3c749
search
IuliiaNova Jan 11, 2023
a015c84
panel.php
valentraverso Jan 11, 2023
2ae0a14
search
IuliiaNova Jan 11, 2023
5150f59
Merge branch 'develop' of https://github.com/valentraverso/filesystem…
valentraverso Jan 11, 2023
d9e5670
show search results
valentraverso Jan 11, 2023
fb3a226
search finished
IuliiaNova Jan 11, 2023
df5986f
sign out, dispaly-information
IuliiaNova Jan 11, 2023
385b923
show info of files
IuliiaNova Jan 11, 2023
3208c47
table shor dates of files
IuliiaNova Jan 11, 2023
ba07b5d
search with popup
valentraverso Jan 11, 2023
eba73ca
Delete root/Folder five directory
valentraverso Jan 11, 2023
859bf39
Merge branch 'develop' of https://github.com/valentraverso/filesystem…
valentraverso Jan 11, 2023
9a35bca
info: date created, modify, size
IuliiaNova Jan 12, 2023
52494ab
add popup file index app
valentraverso Jan 12, 2023
a603d3b
img files
IuliiaNova Jan 12, 2023
e99eb97
cambios despues de pull
IuliiaNova Jan 12, 2023
55c837c
cambios ext img, popUp
IuliiaNova Jan 12, 2023
a6189f9
style table td
valentraverso Jan 12, 2023
5e13905
style table td
valentraverso Jan 12, 2023
1a3f45f
style table td
valentraverso Jan 12, 2023
297a3ec
edir file
IuliiaNova Jan 12, 2023
f89fc89
editor de texto
IuliiaNova Jan 12, 2023
9a4eed5
delete file
IuliiaNova Jan 12, 2023
3776e62
delete file
IuliiaNova Jan 12, 2023
c71825e
delete txt
IuliiaNova Jan 12, 2023
7c8a1fc
logo search
IuliiaNova Jan 12, 2023
1ed6ad6
trash
IuliiaNova Jan 13, 2023
060dd2b
dynamic folder, edit and delete
valentraverso Jan 13, 2023
34d8c9a
dynamic folder, edit and delete
valentraverso Jan 13, 2023
55fce5b
create folder fix
valentraverso Jan 13, 2023
98c5681
create folder fix
valentraverso Jan 13, 2023
73ff8b3
trash
IuliiaNova Jan 13, 2023
9ebb48c
trash
IuliiaNova Jan 13, 2023
ad0a432
display files dinamically
valentraverso Jan 13, 2023
671f03c
create folder button
valentraverso Jan 13, 2023
36afc12
trash
IuliiaNova Jan 13, 2023
97e8f89
trash
IuliiaNova Jan 13, 2023
6ad59a3
message choose a file and btn files
valentraverso Jan 13, 2023
5b73e19
add popup to create file
valentraverso Jan 13, 2023
8b2829b
trash
IuliiaNova Jan 13, 2023
f5d37f4
trash
IuliiaNova Jan 13, 2023
c09efba
upload file with javascript
valentraverso Jan 13, 2023
4f636eb
upload file with javascript
valentraverso Jan 13, 2023
712b397
move between folders
valentraverso Jan 16, 2023
b5e766e
trash
IuliiaNova Jan 16, 2023
ad64c90
trash
IuliiaNova Jan 16, 2023
7b555a5
create folder inside folder
valentraverso Jan 16, 2023
26077af
relocate files between folders
IuliiaNova Jan 16, 2023
5635871
fixed create Folder
valentraverso Jan 16, 2023
a0b2cda
reload
IuliiaNova Jan 16, 2023
2c58f17
bugs fixed
valentraverso Jan 16, 2023
365a217
catch txt
IuliiaNova Jan 16, 2023
5ec5f33
style search bar
valentraverso Jan 16, 2023
0eac0ad
catch pull
IuliiaNova Jan 16, 2023
c938f19
ok
IuliiaNova Jan 16, 2023
c5f3c51
move folder popup
valentraverso Jan 17, 2023
ccd4810
show trash + delete txt
IuliiaNova Jan 17, 2023
0d04234
show trash
IuliiaNova Jan 17, 2023
98ebb0a
show trash folder + delete txt
IuliiaNova Jan 17, 2023
ff8ebd9
fixe bug
valentraverso Jan 17, 2023
97ef9e4
Merge branch 'develop' of https://github.com/valentraverso/filesystem…
valentraverso Jan 17, 2023
274a946
save changes txt, delete txt, style search, style sing out
IuliiaNova Jan 17, 2023
f2d6a77
add to trash
IuliiaNova Jan 17, 2023
ce7c38d
search with folders
valentraverso Jan 17, 2023
989b3c8
Merge branch 'develop' of https://github.com/valentraverso/filesystem…
valentraverso Jan 17, 2023
3631af5
readme
IuliiaNova Jan 17, 2023
ba5eb90
readme
IuliiaNova Jan 17, 2023
399cf23
add folder to trash
valentraverso Jan 17, 2023
9ee6c36
add folder to trash
valentraverso Jan 17, 2023
d8e53cd
readme
IuliiaNova Jan 17, 2023
3d27a1c
readme
IuliiaNova Jan 17, 2023
bc867c4
Update README.md
IuliiaNova Jan 17, 2023
4e4c78a
Update README.md
IuliiaNova Jan 17, 2023
efbc7f3
Update README.md
IuliiaNova Jan 17, 2023
201100c
Update README.md
IuliiaNova Jan 17, 2023
e62a31e
Update README.md
IuliiaNova Jan 17, 2023
0796cf0
Update README.md
IuliiaNova Jan 17, 2023
6364b70
Update README.md
IuliiaNova Jan 17, 2023
71f2999
Update README.md
IuliiaNova Jan 17, 2023
67592f4
improve code and delete files
valentraverso Jan 18, 2023
8b1d97a
improve code and delete files
valentraverso Jan 18, 2023
9158d07
fixed delete trash
valentraverso Jan 18, 2023
f7e0b92
trash bugs
valentraverso Jan 18, 2023
787361d
not add in trash
valentraverso Jan 18, 2023
a75c7d9
reset folder main delete
valentraverso Jan 18, 2023
1efe944
fix upload
valentraverso Jan 18, 2023
168fe87
documantation
IuliiaNova Jan 18, 2023
2c6d00e
doc-tion
IuliiaNova Jan 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 70 additions & 40 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,60 +1,90 @@
`#html` `#css` `#js` `#php` `#master-in-software-development`
# PHP Local FileSystem explorer :technologist:

# PHP Local FileSystem explorer <!-- omit in toc -->
In this project we have created a system file explorer that allows the user to navigate, create directories and upload files in the same way as he would in his usual operating system.

<p>
<img alt="Version" src="https://img.shields.io/badge/version-1.0-blue.svg?cacheSeconds=2592000" />
</p>
The file explorer is a tool that allows you to directly view and manipulate the files and directories associated with a path, so we must take into account from which path the user starts and which path they can access.

>In this project you will have to create a system file explorer that allows the user to navigate, create directories and upload files in the same way as he would in his usual operating system.
## Technologies used

>The file explorer is a tool that allows you to directly view and manipulate the files and directories associated with a path, so you must take into account from which path the user starts and which path they can access.
**For development**

- HTML
- CSS
- JS
- PHP

## Index <!-- omit in toc -->
**For design and planning**
- [Figma](https://www.figma.com/);

- [Requirements](#requirements)
- [Repository](#repository)
- [Technologies used](#technologies-used)
- [Project delivery](#project-delivery)
- [Resources](#resources)
## Before start

## Requirements
Before start this project we have created:

- You cannot use file third-party libraries
- You will not be able to use global variables in PHP.
- You must use GIT
- You must use the PHP > v8
- Create a clear and orderly directory structure
- Both the code and the comments must be written in English
- Use the camelCase code style to define variables and functions
- In the case of using HTML, never use inline styles
- In the case of using different programming languages ​​always define the implementation in separate terms
- Remember that it is important to divide the tasks into several sub-tasks so that in this way you can associate each particular step of the construction with a specific commit
- You should try as much as possible that the commits and the planned tasks are the same
Delete files that are not used or are not necessary to evaluate the project
### **Wireframes of our files explorer**

## Repository
_Wireframe_

First of all you must fork this project into your GitHub account.
<img width="789" alt="Captura de pantalla 2023-01-17 a las 16 24 28" src="https://user-images.githubusercontent.com/115942758/213027634-c7e34342-bd89-4ae5-a396-633ef17f0e77.png">

To create a fork on GitHub is as easy as clicking the “fork” button on the repository page.
_Final Page_

<img src="https://docs.github.com/assets/cb-23088/images/help/repository/fork_button.png" alt="Fork on GitHub" width='450'>
<img width="1319" alt="Captura de pantalla 2023-01-17 a las 23 12 05" src="https://user-images.githubusercontent.com/115942758/213032659-ed9a4e8b-37f7-47a7-9ab9-7a7e5a28e404.png">

## Technologies used
_Final Page with opened folder_

<img width="1381" alt="Captura de pantalla 2023-01-17 a las 23 30 34" src="https://user-images.githubusercontent.com/115942758/213035158-1c75a8f6-d4d5-42a1-8572-1900bf4e6fea.png">


> **Comparison of the original design (Wireframe) with the final result of the project**

As you can see, during the work we have modificated the page for better UX and UI design:

- Added buton "Sing out" if the user want close the session,
- Added folder "Trash" if the user want to restore deleted file in the future,
- The content of the file now we can see in pop-up after "click" at the file(in the wireframe if was situated at rhe right part of display),
- We will be relocated to editor-page if we want to edit file in text format (.txt),
- We will be relocated to search-page if we want to find any file r folder (enter the "first enter" in "search)


### **Use case diagram**

<img width="793" alt="Captura de pantalla 2023-01-17 a las 22 39 33" src="https://user-images.githubusercontent.com/115942758/213028040-f01fc371-5080-4ab3-bec3-deab2ba0741c.png">

> **Comparison of the use case diagram with the actions that the user can finally perform**:

- Log in - yes, Sign up - no;
- If you want Upload file, first you need to choose folder and just then a file;
- Added options: edit text file, relocate files between folders, create subfolders



## Organization and distribution of the tasks

Sush as [**Valentino Traverso**](https://github.com/valentraverso) has more expirience in PHP, he has taken the leading role in this project.

_The biggest part_ of the time we have used **peer coding** to see together how work diferent PHP methods and share experience:
- Interfaces for Log in/Sign out, General Files Explorer page, Edit .txt document;

Then, we shared tasks:
[**Valentino Traverso**](https://github.com/valentraverso): created functions to search files and folders in subfolders;
[**Iuliia Shikhanova**](https://github.com/IuliiaNova): created functions to move files between folders


## Sources of information :bulb:

PHP official [website](https://www.php.net/)

\* HTML

\* CSS
## Goals of the project

\* JS
- Understand how works PHP in the real project,
- Using of fetch to pass dates from PHP to JS,
- Improve our knowledges in logic and programming,
- Understand what is a file system and how it works,

\* PHP

## Resources
## Authors :pencil2:

- [File system](https://es.wikipedia.org/wiki/Administrador_de_archivos)
- [PHP FileSystem W3C](https://www.w3schools.com/php/php_ref_filesystem.asp)
- [PHP FileSystem Oficial](https://www.php.net/manual/es/book.filesystem.php)
- [README Guidelines Example](https://gist.github.com/PurpleBooth/109311bb0361f32d87a2)
This project was made for [Assembler Institute of Technology](https://assemblerinstitute.com/) by:
[**Valentino Traverso**](https://github.com/valentraverso) and
[**Iuliia Shikhanova**](https://github.com/IuliiaNova)
10 changes: 10 additions & 0 deletions assets/add-trash.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

$nombreFile = $_GET['filePath'];

$lastSlash = strrpos($nombreFile, "/");
$fileName = substr($nombreFile, $lastSlash);

rename($nombreFile, '../root/Trash/'.$fileName);

?>
7 changes: 7 additions & 0 deletions assets/close-session.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

session_start();

if(session_destroy()){
header('location: ../index.php');
}
13 changes: 13 additions & 0 deletions assets/create-folder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
$newFolderName = '../root/'.$_GET[ 'nameFolder' ];

if ( file_exists( $newFolderName ) ) {
$status['exists'] = true;
$status['msg'] = 'This folder Already Exist!';
} else {
$status['exists'] = false;
mkdir($newFolderName, 0777);
}

echo json_encode( $status );
?>
7 changes: 7 additions & 0 deletions assets/delete-file.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

$filePath = $_GET["filePath"];

unlink($filePath);

?>
20 changes: 20 additions & 0 deletions assets/delete-folder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
$nombreActual = $_GET["filePath"];

function deleteFolder($dirPath){

$files = glob($dirPath . '/*');
foreach ($files as $file) {
if (is_dir($file)) {
deleteFolder($file);
} else {
unlink($file);
}
}

rmdir($dirPath);
}

deleteFolder('../root/'.$nombreActual);

?>
8 changes: 8 additions & 0 deletions assets/display-content.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

$selectedFolder = $_GET["actualFolderName"];
$resultsFolder = glob("../root/$selectedFolder/*");

echo json_encode($resultsFolder);

?>
16 changes: 16 additions & 0 deletions assets/display-folders.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
$foldersRoot = [];

forEach ( glob( '../root/*' ) as $name ) {
if (is_dir( $name ) && $name !== 'index.php') {
$name = str_replace("../root/", "", $name);

if($name === 'Trash'){
continue;
}

array_push($foldersRoot, $name);
}
}

echo json_encode($foldersRoot);
8 changes: 8 additions & 0 deletions assets/display-info-file.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

$file = $_GET['filePath'];

$content = file_get_contents($file);
echo json_encode($content);

?>
16 changes: 16 additions & 0 deletions assets/display-metadata-file.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

$file = $_GET["filePath"];

$creationDate = date("Y-m-d H:i:s", filectime($file));
$lastModification = date("Y-m-d H:i:s", filemtime($file));
$size = filesize($file);

$information = array("creation" => $creationDate, "modify"=> $lastModification, "size"=> $size);



echo json_encode($information);


?>
Binary file added assets/documentation/Diagram - Diagram copia.pdf
Binary file not shown.
Binary file added assets/documentation/Diagram - Diagram.pdf
Binary file not shown.
Binary file not shown.
17 changes: 17 additions & 0 deletions assets/edit-text.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

$file = $_POST["filePath"];
$text = $_POST["text"];

$openFile = fopen($file, 'w');
fwrite($openFile, $text);
fclose($openFile);

$redirection = str_replace("../", "", $file);

header("location: ../text-editor.php?pathFile=$redirection");

?>
Loading