hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : how to ftp upload a file from a string using php?
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

how to ftp upload a file from a string using php?

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 08-26-2002, 03:53 AM
vSector vSector is offline
Web Hosting Guru
 
Join Date: Jun 2001
Location: rules.php
Posts: 272

how to ftp upload a file from a string using php?


Hi,

I am building a file manager that works on one server(main server) and browsers another(file server) using php and the FTP functions. I am now trying make a section for creating passworded directories.

I need to create an .htaccess and .htpasswd on the file server without creating a the files on the main server. how would i accomplish this?

it would be perfect if there was a ftp_create_file but i dont think there is :-( any suggestions are welcome

__________________
...::: HOST APPROVAL :::...
Web Hosting Directory
http://www.hostapproval.com/
http://www.hostapproval.com/hostadmin/add_your_host.php

Reply With Quote


Sponsored Links
  #2  
Old 08-26-2002, 06:49 AM
Mark-TFL Mark-TFL is offline
Newbie
 
Join Date: Aug 2002
Location: UK
Posts: 13
I think your best bet would be to create the two files on the main server, copy them accross to the FTP server and then delete them from the main server. I don't think there's another way of doing it other than that.

__________________
Mark Carruth

Reply With Quote
  #3  
Old 08-26-2002, 07:54 AM
vSector vSector is offline
Web Hosting Guru
 
Join Date: Jun 2001
Location: rules.php
Posts: 272
yeah thats what i thought...

thanks

__________________
...::: HOST APPROVAL :::...
Web Hosting Directory
http://www.hostapproval.com/
http://www.hostapproval.com/hostadmin/add_your_host.php

Reply With Quote
Sponsored Links
  #4  
Old 08-26-2002, 03:46 PM
apokalyptik apokalyptik is offline
Newbie
 
Join Date: Aug 2002
Posts: 19
+++untested+++

(oops did i just disconnect modem users

anyhow...


i dont have time right now to see if this work, but fopen should be able to open a URL... have you tried

Code:
$fp=fopen('ftp://'.$username.':'.$password.'@'.$hostname.':'.$portnumber.'/path/to/file', 'w');
fputs($fp, 'whatever?');
fclose($fp);
??? just an offhand thought...

(p.s. make sure you have appropriate write access via ftp before testing this...)

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Egnyte Launches Content Cloud Storage and Sharing Infrastructure Service Web Hosting News 2012-11-15 12:01:19
Attunity CloudBeam Allows AWS Customers to Transfer Big Data Across S3 Regions Web Hosting News 2012-07-23 16:45:57
Will ICANN's New gTLD Application System Downtime Affect Web Hosts? Web Hosting News 2012-04-30 16:37:55
Web Hosting Company Server Intellect Adds Support for WebMatrix Website Building Software Web Hosting News 2012-03-14 12:53:32
SingleOS Launches Fuscan Linux Cloud 2.0 Web Hosting News 2011-08-12 19:09:05


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?