Arrow Home arrow Forums
larger font smaller font default font Fixed screen resolution Auto adjust screen size

Joomlapolis Forums  


<< Start < Prev 1 2 Next > End >>
Re:Failed to move uploaded file to /media directory.
Date: 2008/07/18 13:04 By: Sheepy Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 2
graphgraph
I get the problem with CB 1.1 on WAMP too. And I find out what is wrong for us whom file size and permission is not the problem.

Turns out it is not WAMP problem. It's CB problem on Windows.




Simple solution:

1. Open administrator/components/com_comprofiler/admin.comprofiler.controller.php

2. Search for the function name "move_uploaded_file", in my version it is line 3206 in uploadFile()

3. Replace the function name with "rename", so that it now reads:

if (rename( $filename, $baseDir . $userfile_name )) {

or, to add more lines,

if (file_exists( $baseDir )) {
if (is_writable( $baseDir )) {
if (rename( $filename, $baseDir . $userfile_name )) {
if ((!is_callable("mosChmod")) or mosChmod( $baseDir . $userfile_name )) { // mambo 4.5.1 support
return true;

4. Save. Try to upload install again.




Cause of problem:

The problem is that, under windows, tmp_name of uploaded file is in backslashes. Error trace:

1. uploadFile() is called by installPluginUpload() [admin.comprofiler.controller.php:3176]

2. installPluginUpload() calls cbGetParam() to get uploaded file's location [admin.comprofiler.controller.php:3166]

3. cbGetParam() either cast parameters to int or addslashes() them [comprofiler.class.php:1740]

4. uploadFile()'s $filename becomes double-slashed on Windows. Thus it fails is_uploaded_file(). Thus move_uploaded_file() fails.

There are a number of ways this can be properly fixed. Be warned that technically my solution is not that safest one.



EDIT: Backslash also have problem in post rendering. I initially used backslashs for file path but the slashes won't show. Reaaly got some slash problems, uh?

Post edited by: Sheepy, at: 2008/07/18 13:38

Post edited by: Sheepy, at: 2008/07/18 13:43
Click here to see the profile of this user The administrator has disabled public write access.

Re:Failed to move uploaded file to /media director
Date: 2008/09/06 19:23 By: cyberjoex Status: User  
Karma: 2  
Fresh Joomlapolitan

Posts: 1
graphgraph
If you're still having problems installing the component. Maybe you can try this ALTERNATE way of installing the component. It worked on my VirtuaMart installation problem.

1. Unpack the contents of the package.
2. Upload the files to /media or /tmp folder using your FTP client.
3. At your Administrator-> Installers->Components page, specify the direct location of the /media or /tmp folder (depends on where you uploaded) in the “Install directory:” field. A complete path is already specified there, you’d just have to edit the last part.
4. Click Install and you’re finished.
Joe
What I find interesting, I blog it here...
www.extratopics.com
Click here to see the profile of this user The administrator has disabled public write access.

Re:Failed to move uploaded file to /media director
Date: 2008/10/07 00:33 By: dimeoscuro Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 1
graphgraph
cyberjoex wrote:
If you're still having problems installing the component. Maybe you can try this ALTERNATE way of installing the component. It worked on my VirtuaMart installation problem.

1. Unpack the contents of the package.
2. Upload the files to /media or /tmp folder using your FTP client.
3. At your Administrator-> Installers->Components page, specify the direct location of the /media or /tmp folder (depends on where you uploaded) in the “Install directory:” field. A complete path is already specified there, you’d just have to edit the last part.
4. Click Install and you’re finished.


Men, you are the best!!!!!!!!!! One karma lvl up for you ^^!!

This works perfect!

Post edited by: dimeoscuro, at: 2008/10/07 00:34
Click here to see the profile of this user The administrator has disabled public write access.

Re:Failed to move uploaded file to /media director
Date: 2008/10/15 21:30 By: thomas01 Status: User  
Karma: 0  
Fresh Joomlapolitan

Posts: 2
graphgraph
thanx it helped me too
Click here to see the profile of this user The administrator has disabled public write access.

<< Start < Prev 1 2 Next > End >>

Documentation

Documentation Subscription Service
(updated for CB 1.2 RC2)

What?

Why?

Where?

Just click here for answers!

Click here for a yearly subscription: subscribe now

Download Latest Release

The latest stable Community Builder Release is version 1.1 for Joomla 1.0 and Mambo.
You need to be a registered member of Joomlapolis to download.

The latest release candidate of Community Builder is version 1.2 RC3, native for Joomla 1.0, 1.5 and Mambo.
It is available as "thank you" to all CB documentation subscribers at this time.

CB Login