|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
PHP FTP: squares in textfile
Hi,
I build a web-base FTP script. Everything is working but when I open my file on the (unix) server i have strange squares at the end of the line. The script is working on a win NT machine and i am uploading the files to a UNIX machine. I tried to use ASCI and binary as transfert mode but still the same: my file is transferred but wilth squares at the place of new line character: " \n " Every string in my script ends with " \n " to go to a new line. Those strings are then written to a textfile. Thanks in advance. Frederick URL |
|
#2
|
|||
|
|||
|
Welcome to devArticles! Firstly, please dont post on multiple sections, it means we just have to delete one.
Now in regards to your problem. Firstly you should upload text files in binary mode (i think). If you use a normal ftp client does it do the same thing??? also you might want to post your script so that we can have a better idea what your trying to do |
|
#3
|
|||
|
|||
|
PHP FTP squares in text files
Hi,
First i'am really sorry. I will pay attention to this the next time. I want to generate some files at my job on a NT machine. When I press the button "SAVE" I want the file to be saved on a UNIX machine by sending it by FTP, and on the NT machine as safetycopy on harddisk. This is working well but when I'm opening the file on the UNIX machine I see a square on the place where you should have a carriage return. When I'm opening the file on the NT machine I don't see squares (control characters). I tried to send the file in FTP_Binary and in FTP_ASCII but I have the problem in the two cases. The text I am sending is like: $textfield="Hello this is a test\n This is a test2\n And a lot more"; $fp = fopen($temp, "w+"); $write=fwrite($fp, $textfield); FTP part: $conn_id = ftp_connect($ftp_server); $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); $upload = ftp_put($conn_id, $destination_file, $temp, FTP_ASCII); I tried to upload the generated files with an ordinarry FTP program (like WSFTP) and there I didn't encounter this problem. I read in a nwsgrp that return on WIN machine = \r\n and on Unix machine = \n. But I am saving it with "\n", so this is the format for an UNIX machine. Thanks in advance, Frederick |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > PHP FTP: squares in textfile |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|