CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

  Error in PHPUpload when I put it on website

Print topic Send  topic

Author Message
sjb
Posted: 12/25/2002, 3:32 AM

hi....
I'm download PHPUpload.cc example and when I run it on my PC it is working without any problem , but when I put it on my web site this error apear in UploadResult.php page :

----------------------------------------------------
Warning: rename() failed (Invalid cross-device link) in /home/osrtyco/public_html/PHPUpload/UploadResult.php on line 51

Warning: Cannot add header information - headers already sent by (output started at /home/osrtyco/public_html/PHPUpload/UploadResult.php:51) in /home/osrtyco/public_html/PHPUpload/UploadResult.php on line 62
-----------------------------------------------------
any one help me ???
thanks,,
EMG
Posted: 12/25/2002, 9:28 AM

Give us more info for both environments: OS, web server, PHP versions, upload function names.
I suspect it may have to do with PHP version differences (upload functions) or write permissions.
sjb
Posted: 12/26/2002, 1:42 AM

yes
I use PHP 4.0
OS UNIX
feha
Posted: 12/26/2002, 4:01 AM

Try to CHMOD 777 the ctalog/dir You are uploading in to ...





regrad
feha
[www.vision.to]
RipCurl
Posted: 05/14/2003, 3:05 PM

Im experiencing hte same problem, fine on my PC (win2k, apache, php4 mysql 3.23)but uploaded to a

Linux/apacghe/PHP4/MySQL 3.23 environment results in this:

Warning: Rename failed (Invalid cross-device link) in /var/www/html/employee/admin_picupload.php on line 26

Warning: Cannot add header information - headers already sent by (output started at /var/www/html/employee/admin_picupload.php:26) in /var/www/html/employee/admin_picupload.php on line 34


Form for upload:
<form enctype="multipart/form-data" action="admin_picupload.php" method=POST>
Change Image?
<input name="myfile" type="file">
<input type="hidden" name="emp_id" value="{emp_id}">
<input type="submit" value="Attach File" name="submit2">
</form>


UPload script:
<?
//-------------------------------
// admin_employeespicupload CustomIncludes begin

include ("./common.php");
include ("./header.php");
include ("./footer.php");

// admin_employeespicupload CustomIncludes end
//-------------------------------

session_start();
//===============================
// admin_employeespicupload PageSecurity begin
check_security(3);
// admin_employeespicupload PageSecurity end
//===============================

//The file to be uploaded
$tmpfile = "images/emps/".$myfile_name;

if (!file_exists($tmpfile)) {
rename($myfile,$tmpfile);
} else {
unlink($tmpfile);
rename($myfile,$tmpfile);
}

//Update the database table for the new record
$uSQL = "update emps set picture='$myfile_name' where emp_id=".get_param("emp_id");
$db->query($uSQL);

// Redirect the user to the admin_employees.php page
header("Location: admin_employees.php");
?>
rclayh
Posted: 05/15/2003, 10:21 AM

I had to get my Hosting provider to turn safe mode off on my web site to make upload work. It's slight security risk if a user can upload a script file and then execute it but you should be OK if you only accept certain file types.
ripCurl
Posted: 05/15/2003, 1:37 PM

Its an intranet server so that is not really a concern, (safe mode is never on).
I found out that you would need to use move_uploaded_file() instead of rename(), but im getting errors on "moving" the "tmp" file created

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.