473,805 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP FTP (French user please)

Hi
Sorry I don't speak english very vell and no reply in fr news ! ! !

Bonjour,

J'essai d'envoyer par FTP en php un fichier dont le nom, la destination
et la source seront toujours les mêmes.

Voici le code : (rien de compliqué)

*************** *************** *************** *************** ******

$source='//srv-fic01/TeJCommun/site_web_admin/liste_vacpli.sq l';
$destination='/var/www/toitetjoie/maj/liste_vacpli.sq l';
echo $source."<br>";
echo $destination."< br>";
// paramètres de connexion FTP
$ftp_serveur=(' 192.168.99.20') ;
$conn_id=ftp_co nnect($ftp_serv eur);
echo $conn_id."<br>" ;
$reslogin=ftp_l ogin($conn_id,' cepas','tetj');
echo $reslogin."<br> ";
$resput=ftp_put ($conn_id,"$des tination","$sou rce",FTP_BINARY );
echo $resput."<br>";
ftp_quit($conn_ id);

*************** *************** *************** *************** ******

Voici le résultat des echos :

//srv-fic01/TeJCommun/site_web_admin/liste_vacpli.sq l
/var/www/toitetjoie/maj/liste_vacpli.sq l
Resource id #2
1

------------------------------------------------------

Ce que je trouve étrange (mais il y a surement une explication) c'est
que lorsque je passe par un Bt parcourir et l'utilsation de la
viariable $_FILES avec la propriété name, cela fonctionne :

temp=$_FILES['url'];
$_SESSION['vs_pj']=$temp['name'];

Le système gere alors une sorte de fichier temporaire et le ftp
fonctionne...

Merci d'avance pour votre aide précieuse....

Cordialement,

SG
Jan 26 '06 #1
10 1662
Sylvain,

Mais pourquoi tant de " ?

$resput=ftp_put ($conn_id,"$des tination","$sou rce",FTP_BINARY );
<

Le Manuel PHP dit
// upload a file
if (ftp_put($conn_ id, $remote_file, $file, FTP_BINARY)) {
echo "successful ly uploaded $file\n";
} else {
echo "There was a problem while uploading $file\n";
}

Tu as éssayé

$resput=ftp_put ($conn_id,$dest ination,$source ,FTP_BINARY);

??

Lennart Björk
Jan 26 '06 #2
Sylvain GRAVERON wrote:
Sorry I don't speak english very vell and no reply in fr news ! ! !


Salut!

Votre Anglais est bon, vous devriez essayer d'expliquer votre problème
en Anglais.

Your English is good, you should try to explain your problem in English.

Marc
Jan 26 '06 #3
Sylvain GRAVERON wrote:
Hi
Sorry I don't speak english very vell and no reply in fr news ! ! !


Contrary to popular belief, those of us who are ignorant and monolingual
can actually read broken English quite well. It's easier to read broken
(or bad) English than to try and listen to it.

Your English is much better than my <insert any other language here>

--
Justin Koivisto, ZCE - ju****@koivi.co m
http://koivi.com
Jan 26 '06 #4
> Sylvain GRAVERON wrote:
Hi
Sorry I don't speak english very vell and no reply in fr news ! ! !


Contrary to popular belief, those of us who are ignorant and monolingual
can actually read broken English quite well. It's easier to read broken
(or bad) English than to try and listen to it.

Your English is much better than my <insert any other language here>


Ok, I try... (sorry=) ;-(

I try do upload on file that i known name and directory in php

Code :

*************** *************** *************** *************** ******

$source='//srv-fic01/TeJCommun/site_web_admin/liste_vacpli.sq l';
$destination='/var/www/toitetjoie/maj/liste_vacpli.sq l';
echo $source."<br>";
echo $destination."< br>";
// paramèters FTP
$ftp_serveur=(' 192.168.99.20') ;
$conn_id=ftp_co nnect($ftp_serv eur);
echo $conn_id."<br>" ;
$reslogin=ftp_l ogin($conn_id,' cepas','tetj');
echo $reslogin."<br> ";
$resput=ftp_put ($conn_id,"$des tination","$sou rce",FTP_BINARY );
echo $resput."<br>";
ftp_quit($conn_ id);

*************** *************** *************** *************** ******

This de result of echos :

//srv-fic01/TeJCommun/site_web_admin/liste_vacpli.sq l
/var/www/toitetjoie/maj/liste_vacpli.sq l
Resource id #2
1

------------------------------------------------------

If and do the same think with a browse button, it's OK. The system use
$_FILES [name]
temp=$_FILES['url'];
$_SESSION['vs_pj']=$temp['name'];

The system call probably a temporary file and upload

Thank you for help.

Sincerely,

SG
Jan 26 '06 #5
SG
Lennart Björk avait écrit le 26/01/2006 :
Sylvain,

Mais pourquoi tant de " ?
>

$resput=ftp_put ($conn_id,"$des tination","$sou rce",FTP_BINARY );
<

Le Manuel PHP dit
// upload a file
if (ftp_put($conn_ id, $remote_file, $file, FTP_BINARY)) {
echo "successful ly uploaded $file\n";
} else {
echo "There was a problem while uploading $file\n";
}

Tu as éssayé

$resput=ftp_put ($conn_id,$dest ination,$source ,FTP_BINARY);

??

Lennart Björk


Yes

It's don't works.
Maybe i find. I forgot the protocol.
File is on a files server (windows) Monday I will try this :

$source=file:///'srv-fic01/TeJCommun/site_web_admin/liste_vacpli.sq l';

What do you think about this ?

Tks

--
------------------------------------------

Cordialement

SG

Jan 26 '06 #6
Sylvain GRAVERON wrote:
Sylvain GRAVERON wrote:
Hi
Sorry I don't speak english very vell and no reply in fr news ! ! !


Contrary to popular belief, those of us who are ignorant and monolingual
can actually read broken English quite well. It's easier to read broken
(or bad) English than to try and listen to it.

Your English is much better than my <insert any other language here>


Ok, I try... (sorry=) ;-(

I try do upload on file that i known name and directory in php

Code :

*************** *************** *************** *************** ******

$source='//srv-fic01/TeJCommun/site_web_admin/liste_vacpli.sq l';
$destination='/var/www/toitetjoie/maj/liste_vacpli.sq l';
echo $source."<br>";
echo $destination."< br>";
// paramèters FTP
$ftp_serveur=(' 192.168.99.20') ;
$conn_id=ftp_co nnect($ftp_serv eur);
echo $conn_id."<br>" ;
$reslogin=ftp_l ogin($conn_id,' cepas','tetj');
echo $reslogin."<br> ";
$resput=ftp_put ($conn_id,"$des tination","$sou rce",FTP_BINARY );
echo $resput."<br>";
ftp_quit($conn_ id);

*************** *************** *************** *************** ******

This de result of echos :

//srv-fic01/TeJCommun/site_web_admin/liste_vacpli.sq l
/var/www/toitetjoie/maj/liste_vacpli.sq l
Resource id #2
1

------------------------------------------------------

If and do the same think with a browse button, it's OK. The system use
$_FILES [name]
temp=$_FILES['url'];
$_SESSION['vs_pj']=$temp['name'];

The system call probably a temporary file and upload

Thank you for help.


I'm thinking that your problem is the source file. You reference it
starting with "//"

try adding something like this to check on that:

var_dump(file_e xists($source)) ;

if you get "bool(false )" then your problem is there. In order to put the
file somewhere, the system needs to know where the source is. If it
doesn't think it exists, then you can't successfully upload it...
BTW - your english isn't that bad at all. Definitely enough to get the
message across. ;)

--
Justin Koivisto, ZCE - ju****@koivi.co m
http://koivi.com
Jan 26 '06 #7
Sylvain,
$source=file:///'srv-fic01/TeJCommun/site_web_admin/liste_vacpli.sq l';

What do you think about this ?
<

I think you should start by checking if the file really is there (or
even available to you there). Justin Koivisto gives you that hint in his
message here.

As a general rule I think you schould check the results of your actions.
You mentioned that you got
Resource id #2
1
<
What does that '1' mean? Isn't that the result of your

$resput=ftp_put ($conn_id,"$des tination","$sou rce",FTP_BINARY );
<
?
The result of the ftp_put() seems to be ok. But if there is nothing to
put nothing is put, bien que le put lui-même marche très bien. You can
test how ftp_put() works in this respect by asking it to send something
you know is not there, and keep a tight eye on the return value.

Lennart Björk
Jan 27 '06 #8
Lennart Björk wrote:
Sylvain,
> $source=file:///'srv-fic01/TeJCommun/site_web_admin/liste_vacpli.sq l';

What do you think about this ?
<


"file:" would only work if accessible through local filesystem.

I think you should start by checking if the file really is there (or
even available to you there). Justin Koivisto gives you that hint in his
message here.


Quite so.

As far as I know, PHP has no wrapper for the smb-protocol so, unless
natively supported by the OS, PHP cannot directly access shared
folders on remote windows servers.

Perhaps the simplest would be to let the linux (or what have you),
access the windows server through http or ftp.
/Bent

[snip]
Jan 27 '06 #9
SG
Bent Stigsen a pensé très fort :
Lennart Björk wrote:
Sylvain,
>

$source=file:///'srv-fic01/TeJCommun/site_web_admin/liste_vacpli.sq l';

What do you think about this ?
<


"file:" would only work if accessible through local filesystem.

I think you should start by checking if the file really is there (or even
available to you there). Justin Koivisto gives you that hint in his message
here.


Quite so.

As far as I know, PHP has no wrapper for the smb-protocol so, unless natively
supported by the OS, PHP cannot directly access shared folders on remote
windows servers.

Perhaps the simplest would be to let the linux (or what have you), access the
windows server through http or ftp.
/Bent

[snip]


Ok,
i'll try with ftp or http on my win2003 to My debian. (My debian is
installed with samba... Maybe ! ! !)

I try monday and i 'll say to you the result.

:'( I known my english is very very BAAAAAAAAAD ! ! ! !

SG

--
------------------------------------------

Cordialement

SG
Jan 27 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

38
5748
by: Haines Brown | last post by:
I'm having trouble finding the character entity for the French abbreviation for "number" (capital N followed by a small supercript o, period). My references are not listing it. Where would I find an answer to this question (don't find it in the W3C_char_entities document). -- Haines Brown brownh@hartford-hwp.com
1
2666
by: Gina | last post by:
Hi everybody: I need some help to load in the as/400, a file with fields that have french characters . I have created a file with language = FRC and ccsid = 500 and also I have tried with ccsid = 297 but when I load the file , the french characters does not appear correctly. Please let me know what is missing? The file that I'm loading comes in a tape and I'm making a copy from tape to the file created with the above specifications.
8
393
by: Ess355 | last post by:
Hi, In the debugger at run time, characters like é are not recognised by their normal ASCII number, but something like -8615722... . I've seen this number before, it means "rubbish" right? So how can I possible modify my program so that french characters get recognised? Thanks in advance,
13
2791
by: jd | last post by:
I have just spent the past week reading up on locales in books by Josuttis and Stroustrup. As a simple test of locales, I prepared the following source code below. The purpose is to convert the French decimal number 1.234,567 to the English equivalent of 1,234.567. std::locale oFrenchLocale( "French_Canada.1252" ); std::string oS = "1.234,456"; std::istringstream oISS( oS ); std::locale oOldLocale = oISS.imbue( oFrenchLocale );
9
3954
by: kaustubh.deo | last post by:
I am facing issues printing french chars like using printf function. I have reproduced this issue with simple C program as follows. #include <stdio.h> #include <locale.h> int main(int argc, char **argv) {
2
2604
by: Marcel Saucier | last post by:
Hi Everybody, At run time, regardless of the computer regional settings, is there a simple way of swtiching the DateTime Picker in French (fr-CA) or in English (en-US) depending of the user selection. The user of my small application can switch the entire application to French or English, but I dont know how to work with the DTP, that stays only in English because of my computer regional settings.
1
3062
by: bssjohn | last post by:
Dear All, I have developing a French website using PHP & Ajax. In that I tried to display some French texts from mysql database using Ajax. Form local I got the text from db with Correct accents but in online French accents are missing. The text displays like this “de r?isation pour regroup?a majorit?es “. I declared following code in the head section of the file. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
3
5934
by: bss | last post by:
Dear All, I have developing a French website using PHP & Ajax. In that I tried to display some French texts from mysql database using Ajax. Form local I got the text from db with Correct accents but in online French accents are missing. The text displays like this "de r?isation pour regroup?a majorit?es ". I declared following code in the head section of the file. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
7
20316
chunk1978
by: chunk1978 | last post by:
i though i had this under control, but i'm completely lost... i have a form which allows a user to fill out information, which is then emailed to myself as well as themselves... the form is obviously sent by PHP mail. everything seemed to be working when i text encoded the sent email with UTF-8... but then i tried it in Yahoo Mail, and i got those "?" symbols where french characters like "é" or "ç" were suppose to be... i've read up...
0
2307
by: shintu | last post by:
Hallo, I am trying to write french accented characters é è ê in Excel worksheet using my perl script , But I am stuck here as I couldnt find a way of writing it !: My code: use strict; use warnings;
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10359
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10364
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7645
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6875
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5541
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4317
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3843
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.