Transfert de fichier socket sans passer au socketServeur
bodo2011
Messages postés9Date d'inscriptionmardi 25 janvier 2011StatutMembreDernière intervention11 juin 2012
-
1 juin 2012 à 16:43
Utilisateur anonyme -
2 juin 2012 à 13:27
bjr a tous!
Je fait un tranfert de fichier socket(client /serveur) ss passer au socketServeur
Voici mon code:
public class FileUploadDemo1 {
public static void main(String[] args) {
httpClient client = new httpClient();
URL url = new URL("http://localhost/lbmis-dev/server-scripts/grievance/upl.php");
PostMethod mPost = new PostMethod(url);
MultipartPostMethod mPost = new MultipartPostMethod(url);
// Send any XML file as the body of the POST request
File f1 = new File("C:/aa.jpg");
}
}
Je suis coince sur des beugs.Est ce quelqu'un peut m'aide SLVP?
Voici les beugs:
-error:no suitable constructor found for PostMethod(URL)
-error:cannot find symbol : class MultipartPostMethod
-error:cannot find symbol : class httpClient
-error: mPost is already defined in main(String[])
A voir également:
Transfert de fichier socket sans passer au socketServeur
-error:cannot find symbol : class MultipartPostMethod
-error:cannot find symbol : class httpClient
Vérifie si tu as bien importé les classes httpClient et MultipartPostMethod. Honnêtement, j'ai des doutes que ta classe httpClient existe, ou alors tu l'as mal écrite.
-error:no suitable constructor found for PostMethod(URL)
Tu n'utilises pas le bon constructeur, visiblement il n'y en a pas qui prennent une URL pour PostMethod.
Bref, vérifie si tu as fait de bonnes importations.
--
Pylouq (Lire le Réglement n'a jamais tué personne, au pire ça a instruit des gens.)