?

Search Help Board

PHP FAQ
PHP Articles
PHP Help
Bulletin Board

PHP Manual (NEW!)
First Time PHP'ers
Help with programming
Sql assignment help
PHP Homework Help


C# Help

?
?Problem with copy function
Author:??(---.reverse.newskies.net)
Date:???03-03-04 19:04

Dear all,

I was searching a script to upload file from a local pc to web server. Then I found a script and trying to adjust with my script. But when I run the script I got an error. The error was - "The file you are trying to upload couldn't be copied to the server" or "Couldn't Copy File To Server ". So any body please can help me? How can I solve this problem? My code was like -
$absolute_path = "/home/www/docs/servername/uploads";
@copy($file, "$absolute_path/$file_name")

I'm waiting for reply. please help me.

sayma

?Re: Problem with copy function
Author:??(---.cpe.net.cable.roger)
Date:???03-03-04 20:13

You can only copy from folder to folder on the server, if the file is not uploaded yet, then this will fail...Read the manual section on file uploads to see how it works...

?Re: Problem with copy function
Author:??(---.reverse.newskies.net)
Date:???03-03-04 20:29

thanks for mail. May I ask you another question. I'm trying to uplaod file by uisng ftp_connect. This is working fine but I cann't upload big size file. Like i want to upload more then 2 mb file. So how can I upload this. my ftp command is like this -

$upload=ftp_put($connect, $dest, $source, FTP_BINARI);

please advice me.

saymabastien wrote:
>
> You can only copy from folder to folder on the server, if the
> file is not uploaded yet, then this will fail...Read the
> manual section on file uploads to see how it works...

?Re: Problem with copy function
Author:??(---.scpe.powergate.ca)
Date:???03-04-04 05:22

There is a setting in the ini file that controls the max size of the upload. The default setting is 2M. Simply open the ini file with a text editor and reset the size to something larger

hth

?Re: Problem with copy function
Author:??(---.reverse.newskies.net)
Date:???03-06-04 20:17

Hi thanks for your reply. May I ask you one thing how can I do this. Cause I can't find the defualt setting for file size. Cause I don't have enough idea abt this. Please waiting for your reply.

?Re: Problem with copy function
Author:??(---.cpe.net.cable.roger)
Date:???03-07-04 05:20

in the ini file look for this:

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
;upload_tmp_dir =

; Maximum allowed size for uploaded files.
upload_max_filesize = 2M <--change this value

?Re: Problem with copy function
Author:??(---.reverse.newskies.net)
Date:???03-07-04 18:18

Thanks for your mail. May I ask you one more question?

in the ini file look for this:

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use
system default if not
; specified).
;upload_tmp_dir = <-- is this place used for upload file by HTTP? if yes then what will be the value? How can I set this. I think thats why my copy function is not working. Could you please tell me?

; Maximum allowed size for uploaded files.
upload_max_filesize = 2M <--change this value

Thanks a lot again.

?Re: Problem with copy function
Author:??(---.cpe.net.cable.roger)
Date:???03-08-04 16:10

upload_tmp_dir depends on the server set up that is available. consult the sysadmin for more details as to where the files are allowed to go temporarily.

It should be any folder on the file system. ensure that the folder has permission to be written to.

Go to Top??|??Go to Topic??|??Threaded View??|??Search?
??|??
New Topic
?Reply To This Message
?Your Name:
?Your Email:
?Subject:
Email replies to this thread, to the address above.
??

Provided By
Phorum