Skip to content
Snippets Groups Projects
Commit 9ffb5646 authored by fabiovandewaeter's avatar fabiovandewaeter
Browse files

save

parent 9a3df93f
No related branches found
No related tags found
No related merge requests found
......@@ -88,6 +88,45 @@ curl -X POST -H "X-Resource-Type: file" -H "Authorization: Bearer valid-token-1"
curl -X DELETE -H "Authorization: Bearer valid-token-1" -H "X-FTP-User: user" -H "X-FTP-Pass: password" http://localhost:8080/ftps/mon-ftp/dossier1_nouveau_nom
```
#### 3) Exemple download et upload fichiers et dossiers
On montre que l'on peut télécharger une image sur le serveur2 et l'envoyer sur le serveur1 :
- download image :
```shell
curl -X GET -H "Authorization: Bearer valid-token-1" -H "X-FTP-User: anonymous" -H "X-FTP-Pass: anonymous" http://localhost:8080/ftps/mon-ftp2/image0.png -o image0.png
```
- upload image :
```shell
curl -X PUT -H "Authorization: Bearer valid-token-1" -H "X-FTP-User: user" -H "X-FTP-Pass: password" --upload-file image0.png http://localhost:8080/ftps/mon-ftp/image0.png
```
Ensuite on montre que l'on peut envoyer un dossier en commençant par en faire un zip, et que l'on peut télécharger le `dossier0` qui est sur le serveur2 :
- upload dossier :
```shell
zip -r dossier1.zip dossier1
curl -X POST -H "Authorization: Bearer valid-token-1" -H "X-FTP-User: user" -H "X-FTP-Pass: password" -H "Content-Type: application/octet-stream" --data-binary @dossier1.zip http://localhost:8080/ftps/mon-ftp/upload-dir/dossier1
```
- download dossier :
```shell
curl -X GET -H "Authorization: Bearer valid-token-1" -H "X-FTP-User: anonymous" -H "X-FTP-Pass: anonymous" http://localhost:8080/ftps/mon-ftp2/dossier0 -o dossier0.zip
unzip dossier1.zip
```
#### 4) Exemple chercher des fichiers stockés dans plusieurs serveurs FTP
Maintenant que l'on a `image0.png` sur les deux serveur on peut utiliser la commande suivante pour obtenir les URLs des fichiers qui sont sur deux serveurs FTP :
- rechercher une ressource :
```shell
curl -X GET -H "Authorization: Bearer valid-token-1" -H "X-FTP-User: user" -H "X-FTP-Pass: password" http://localhost:8080/ftps/search/image0.png
```
## Instructions de build et d'exécution SANS la vidéo
### Build l'archive
......@@ -158,41 +197,43 @@ curl -X GET -H "Authorization: Bearer valid-token-1" -H "X-FTP-User: anonymous"
**Note comprise entre 11 et 12 si—en plus—le proxy FlopBox, permet de télécharger (download) et téléverser (upload) un petit fichier texte:**
- download fichier :
- upload fichier :
```shell
curl -X GET -H "Authorization: Bearer valid-token-1" -H "X-FTP-User: anonymous" -H "X-FTP-Pass: anonymous" http://localhost:8080/ftps/mon-ftp/fichier1 -o fichier1
curl -X PUT -H "Authorization: Bearer valid-token-1" -H "X-FTP-User: user" -H "X-FTP-Pass: password" --upload-file fichier2 http://localhost:8080/ftps/mon-ftp/fichier2
```
- download dossier (ne fonctionne pas bien pour le moment je crois) :
- upload dossier :
```shell
curl -X GET -H "Authorization: Bearer valid-token-1" -H "X-FTP-User: anonymous" -H "X-FTP-Pass: anonymous" http://localhost:8080/ftps/mon-ftp/dossier1 -o dossier1.zip
zip -r dossier1.zip dossier1
unzip dossier1.zip
curl -X POST -H "Authorization: Bearer valid-token-1" -H "X-FTP-User: user" -H "X-FTP-Pass: password" -H "Content-Type: application/octet-stream" --data-binary @dossier1.zip http://localhost:8080/ftps/mon-ftp/upload-dir/dossier1
```
- upload fichier :
- download fichier :
```shell
curl -X PUT -H "Authorization: Bearer valid-token-1" -H "X-FTP-User: user" -H "X-FTP-Pass: password" --upload-file fichier2 http://localhost:8080/ftps/mon-ftp/fichier2
curl -X GET -H "Authorization: Bearer valid-token-1" -H "X-FTP-User: anonymous" -H "X-FTP-Pass: anonymous" http://localhost:8080/ftps/mon-ftp/fichier1 -o fichier1
```
- upload dossier :
- download dossier :
```shell
zip -r dossier2.zip dossier2
curl -X GET -H "Authorization: Bearer valid-token-1" -H "X-FTP-User: anonymous" -H "X-FTP-Pass: anonymous" http://localhost:8080/ftps/mon-ftp/dossier1 -o dossier1.zip
curl -X POST -H "Authorization: Bearer valid-token-1" -H "X-FTP-User: user" -H "X-FTP-Pass: password" -H "Content-Type: application/octet-stream" --data-binary @dossier2.zip http://localhost:8080/ftps/mon-ftp/upload-dir/dossier2
unzip dossier1.zip
```
**Note comprise entre 12 et 13 si—en plus—le proxy FlopBox, permet de télécharger (download) et téléverser (upload) un gros fichier binaire (image, vidéo, etc.):**
- download fichier :
(comme dans l'étape d'avant on peut envoyer et télécharger des images)
- upload image :
```shell
curl -X GET -H "Authorization: Bearer valid-token-1" -H "X-FTP-User: anonymous" -H "X-FTP-Pass: anonymous" http://localhost:8080/ftps/mon-ftp/image.png -o image.png
curl -X PUT -H "Authorization: Bearer valid-token-1" -H "X-FTP-User: user" -H "X-FTP-Pass: password" --upload-file image.png http://localhost:8080/ftps/mon-ftp/image.png
```
- upload fichier :
- download image :
```shell
curl -X PUT -H "Authorization: Bearer valid-token-1" -H "X-FTP-User: user" -H "X-FTP-Pass: password" --upload-file image2.jpg http://localhost:8080/ftps/mon-ftp/image2.jpg
curl -X GET -H "Authorization: Bearer valid-token-1" -H "X-FTP-User: anonymous" -H "X-FTP-Pass: anonymous" http://localhost:8080/ftps/mon-ftp/image0.png -o image0.png
```
**Note comprise entre 13 et 14 si—en plus—le proxy FlopBox permet de gérer plusieurs serveurs FTP différents (ajout, suppression, modification des serveurs):**
......
FICHIER01
dossier_serveur_ftp2/image0.jpg

57.8 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment