J'ai une petite question, qui concerne les uploads multiple a partir d'une URL:
Je vous montre tout d'abord un exemple pour vous illustrer le problème:
J'ai crée pour le moment ca:
http://edt.esiea.fr.nf/Planning_test/edt_maj.php
Le code est ici:
CODE
<?php
/*Calcul de la date de début / fin*/
$timestamp = time();
/*Tant qu'on est pas un vendredi, on avance de jour.*/
while(date('N', $timestamp) != 5)
{
$timestamp += 60*60*24;
}
//$jours_ecart = 2; //nombre de jours avant vendredi. 0 car script lancé vendredi
$correction_tests = 60*60*24*$jours_ecart;
$timestamp +=$correction_tests;
$timestampdebut = $timestamp +60*60*24*3;
$timestampfin = $timestamp +60*60*24*8;
$date_debut = date('dmy', $timestampdebut);
$date_fin = date('dmy', $timestampfin);
//echo "Now (Vendredi, 4PM):".date('dmy', $timestamp)."<br />Lundi : ".$date_debut."<br />Samedi :".$date_fin."<br />";
/*URL pour la 11*/
$classe="11";
$url_11 = "http://grieg.esiea-ouest.fr/edtps/paris/diplomes/CLASSE_.32,".$classe."_.95,TD_.32,".$classe."_.95,T_.32,_.32,_.32,_.32,2_".$date_debut."_".$date_fin.".gif";
/*URL pour la 12*/
$classe="12";
$url_12 = "http://grieg.esiea-ouest.fr/edtps/paris/diplomes/CLASSE_.32,".$classe."_.95,TD_.32,".$classe."_.95,T_.32,_.32,_.32,_.32,2_".$date_debut."_".$date_fin.".gif";
/*URL pour la 21*/
$classe="21";
$url_21 = "http://grieg.esiea-ouest.fr/edtps/paris/diplomes/CLASSE_.32,".$classe."_.95,TD_.32,".$classe."_.95,T_.32,_.32,_.32,_.32,5_".$date_debut."_".$date_fin.".gif";
/*URL pour la 22*/
$classe="22";
$url_22 = "http://grieg.esiea-ouest.fr/edtps/paris/diplomes/CLASSE_.32,".$classe."_.95,TD_.32,".$classe."_.95,T_.32,_.32,_.32,_.32,5_".$date_debut."_".$date_fin.".gif";
/*URL pour la 31*/
$classe="31";
$url_31 = "http://grieg.esiea-ouest.fr/edtps/paris/diplomes/CLASSE_.32,".$classe."_.95,TD_.32,".$classe."_.95,T_.32,_.32,122_".$date_debut."_".$date_fin.".gif";
/*URL pour la 32*/
$classe="32";
$url_32 = "http://grieg.esiea-ouest.fr/edtps/paris/diplomes/CLASSE_.32,".$classe."_.95,TD_.32,".$classe."_.95,T_.32,_.32,122_".$date_debut."_".$date_fin.".gif";
/*URL pour la 41*/
$classe="41";
$url_41 = "http://grieg.esiea-ouest.fr/edtps/paris/diplomes/CLASSE_.32,".$classe."_.95,TD_.32,".$classe."_.95,T_.32,_.32,125_".$date_debut."_".$date_fin.".gif";
/*URL pour la 42*/
$classe="42";
$url_42 = "http://grieg.esiea-ouest.fr/edtps/paris/diplomes/CLASSE_.32,".$classe."_.95,TD_.32,".$classe."_.95,T_.32,_.32,125_".$date_debut."_".$date_fin.".gif";
/*URL pour la 43*/
$classe="43";
$url_43 = "http://grieg.esiea-ouest.fr/edtps/paris/diplomes/CLASSE_.32,".$classe."_.95,TD_.32,".$classe."_.95,T_.32,_.32,125_".$date_debut."_".$date_fin.".gif";
echo "11 : ".$url_11."<br />";
echo "11 : ".$url_12."<br />";
echo "21 : ".$url_21."<br />";
echo "22 : ".$url_22."<br />";
echo "31 : ".$url_31."<br />";
echo "31 : ".$url_32."<br />";
echo "41 : ".$url_41."<br />";
echo "42 : ".$url_42."<br />";
echo "43 : ".$url_43."<br />";
echo "11 : <img src=\"".$url_11."\" /><br />";
echo "12 : <img src=\"".$url_12."\" /><br />";
echo "21 : <img src=\"".$url_21."\" /><br />";
echo "22 : <img src=\"".$url_22."\" /><br />";
echo "31 : <img src=\"".$url_31."\" /><br />";
echo "32 : <img src=\"".$url_32."\" /><br />";
echo "41 : <img src=\"".$url_41."\" /><br />";
echo "42 : <img src=\"".$url_42."\" /><br />";
echo "43 : <img src=\"".$url_43."\" /><br />";
?>
/*Calcul de la date de début / fin*/
$timestamp = time();
/*Tant qu'on est pas un vendredi, on avance de jour.*/
while(date('N', $timestamp) != 5)
{
$timestamp += 60*60*24;
}
//$jours_ecart = 2; //nombre de jours avant vendredi. 0 car script lancé vendredi
$correction_tests = 60*60*24*$jours_ecart;
$timestamp +=$correction_tests;
$timestampdebut = $timestamp +60*60*24*3;
$timestampfin = $timestamp +60*60*24*8;
$date_debut = date('dmy', $timestampdebut);
$date_fin = date('dmy', $timestampfin);
//echo "Now (Vendredi, 4PM):".date('dmy', $timestamp)."<br />Lundi : ".$date_debut."<br />Samedi :".$date_fin."<br />";
/*URL pour la 11*/
$classe="11";
$url_11 = "http://grieg.esiea-ouest.fr/edtps/paris/diplomes/CLASSE_.32,".$classe."_.95,TD_.32,".$classe."_.95,T_.32,_.32,_.32,_.32,2_".$date_debut."_".$date_fin.".gif";
/*URL pour la 12*/
$classe="12";
$url_12 = "http://grieg.esiea-ouest.fr/edtps/paris/diplomes/CLASSE_.32,".$classe."_.95,TD_.32,".$classe."_.95,T_.32,_.32,_.32,_.32,2_".$date_debut."_".$date_fin.".gif";
/*URL pour la 21*/
$classe="21";
$url_21 = "http://grieg.esiea-ouest.fr/edtps/paris/diplomes/CLASSE_.32,".$classe."_.95,TD_.32,".$classe."_.95,T_.32,_.32,_.32,_.32,5_".$date_debut."_".$date_fin.".gif";
/*URL pour la 22*/
$classe="22";
$url_22 = "http://grieg.esiea-ouest.fr/edtps/paris/diplomes/CLASSE_.32,".$classe."_.95,TD_.32,".$classe."_.95,T_.32,_.32,_.32,_.32,5_".$date_debut."_".$date_fin.".gif";
/*URL pour la 31*/
$classe="31";
$url_31 = "http://grieg.esiea-ouest.fr/edtps/paris/diplomes/CLASSE_.32,".$classe."_.95,TD_.32,".$classe."_.95,T_.32,_.32,122_".$date_debut."_".$date_fin.".gif";
/*URL pour la 32*/
$classe="32";
$url_32 = "http://grieg.esiea-ouest.fr/edtps/paris/diplomes/CLASSE_.32,".$classe."_.95,TD_.32,".$classe."_.95,T_.32,_.32,122_".$date_debut."_".$date_fin.".gif";
/*URL pour la 41*/
$classe="41";
$url_41 = "http://grieg.esiea-ouest.fr/edtps/paris/diplomes/CLASSE_.32,".$classe."_.95,TD_.32,".$classe."_.95,T_.32,_.32,125_".$date_debut."_".$date_fin.".gif";
/*URL pour la 42*/
$classe="42";
$url_42 = "http://grieg.esiea-ouest.fr/edtps/paris/diplomes/CLASSE_.32,".$classe."_.95,TD_.32,".$classe."_.95,T_.32,_.32,125_".$date_debut."_".$date_fin.".gif";
/*URL pour la 43*/
$classe="43";
$url_43 = "http://grieg.esiea-ouest.fr/edtps/paris/diplomes/CLASSE_.32,".$classe."_.95,TD_.32,".$classe."_.95,T_.32,_.32,125_".$date_debut."_".$date_fin.".gif";
echo "11 : ".$url_11."<br />";
echo "11 : ".$url_12."<br />";
echo "21 : ".$url_21."<br />";
echo "22 : ".$url_22."<br />";
echo "31 : ".$url_31."<br />";
echo "31 : ".$url_32."<br />";
echo "41 : ".$url_41."<br />";
echo "42 : ".$url_42."<br />";
echo "43 : ".$url_43."<br />";
echo "11 : <img src=\"".$url_11."\" /><br />";
echo "12 : <img src=\"".$url_12."\" /><br />";
echo "21 : <img src=\"".$url_21."\" /><br />";
echo "22 : <img src=\"".$url_22."\" /><br />";
echo "31 : <img src=\"".$url_31."\" /><br />";
echo "32 : <img src=\"".$url_32."\" /><br />";
echo "41 : <img src=\"".$url_41."\" /><br />";
echo "42 : <img src=\"".$url_42."\" /><br />";
echo "43 : <img src=\"".$url_43."\" /><br />";
?>
J'aimerai grace a ce script récupéré image par image et les mettre sur mon FTP avec le nom correspondant:
Exemple: 11 etant le nom de l'image qui doit etre uploader sur le serveur avec comme adresse URL http://grieg.esiea-ouest.fr/edtps/paris/diplomes/CLASSE_.32,11_.95,TD_.32,11_.95,T_.32,_.32,_.32,_.32,2_031207_081207.gif
Ainsi de suite...
11 : -http://grieg.esiea-ouest.fr/edtps/paris/diplomes/CLASSE_.32,11_.95,TD_.32,11_.95,T_.32,_.32,_.32,_.32,2_031207_081207.gif
12 : -http://grieg.esiea-ouest.fr/edtps/paris/diplomes/CLASSE_.32,12_.95,TD_.32,12_.95,T_.32,_.32,_.32,_.32,2_031207_081207.gif
21 : -http://grieg.esiea-ouest.fr/edtps/paris/diplomes/CLASSE_.32,21_.95,TD_.32,21_.95,T_.32,_.32,_.32,_.32,5_031207_081207.gif
Si quelqu'un pouvait me modifier le script pour uploader ca en FTP ou directement par HTTP se serait SUPER !!
Merci d'avance à tous pour votre aide