|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
|
|
#1
|
|||
|
|||
|
ftp
hi,
i have writen this block of code to connect, login and upload a file to an ftp: <? $conn = ftp_connect("localhost"); $user = ""; $pass = ""; $result = ftp_login($conn, $user, $pass); if(!$result) { echo "cannot log you in"; ftp_quit($conn); exit; } $upfile = "/Inetpub/ftproot/".$userfile_name; ftp_fput($conn, $upfile, FTP_BINARY) ?> , but when the script runs i get this error message: Warning: Unable to find ftpbuf 0 in c:\apache\htdocs\production\upload.php on line 11 cannot log you in any ideas? thanks, MIKE |
|
#2
|
|||
|
|||
|
It appears to be a configuration problem relating to PHP within Apache. Unfortunately, I'm just getting into this myself, so I don't know exactly where you go to fix that.
![]() |
|
#3
|
||||
|
||||
|
hi u r mistaken about how ftp_fput works.
this is from manual Quote:
u dont pass a file name to ftp_fput but a file pointer. so correct way is this. PHP Code:
i hope it helps, jd
__________________
_____________________________ d.k.jariwala (JD) ~ simple thought, simple act ~ I blog @ http://jdk.phpkid.org Last edited by jdk : July 28th, 2001 at 08:31 AM. |
|
#4
|
|||
|
|||
|
ok,
I have another page that allows a user to browse the local files on his HD, now i want the user to be able to ftp his local file via ftp to my remote ftp server. This was what i was trying to do with that script. how would i go about that, MIKE |
|
#5
|
||||
|
||||
|
hi,
i think u would have to take 2 steps here. first let him upload the file. as u know it would be uploaded to temp directory. i hope u know how file uploading works in php. once it is uploaded do a fopen and get file pointer . now provide that to ftp_fput. once file is uploaded delete the uploaded file from temp directory. getting ?? jd |
|
#6
|
|||
|
|||
|
ok, why cant i bypass the temp directory.
lemme explain what exactly this is for. I run a website for a publisher and am setting up a backend for our advertisers to upload and view their ads from our in-house file server. So the script will be executed from the remote webserver, not hosted by us, and will upload the file to our file server in our office. But i also have apache on our file server so i can have the backend hosted on our file server. Which is the better way to go? Now one major problem with this is that these files can exced 10MB, so i figured that if u used ftp the browser and php would not timeout, is this true? If not, should i use cURL or maybe something with sockets. I just got started with php and have a very week idea of c++ and c. MIKE |
|
#7
|
|||||
|
|||||
|
Quote:
...hm..i dont think it would be possible to upload file DIRECTLY from user to ftp account. anyways check out others views. Quote:
fine..i got the whole idea. idea is good. i dont get u by what u mean to say which way to go ?? i think u have only one ftp server right ? plz give more clarification. and in general, u should opt for ftp server, to which script would be able to communicate at MORE speed. using ur own server would be slow as u wont have as fast link as ISPs do.right ?? Quote:
hm..i dont think u would be able to upload 10mb through a php file. certainly it would timeout if client doesnt have FAST connection. and let me emphasize FAST. btw i dont have any idea about cURL,plz let me know what it is. i think u would have to find some other way round, jd |
![]() |
| Viewing: Dev Shed Forums > System Administration > FTP Help > ftp |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|