PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Iron Speed
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old September 25th, 2002, 04:11 AM
freeland freeland is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: BE
Posts: 4 freeland User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old September 25th, 2002, 05:46 AM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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

Reply With Quote
  #3  
Old September 25th, 2002, 07:31 AM
freeland freeland is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: BE
Posts: 4 freeland User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > PHP FTP: squares in textfile


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway