News:

Support for jDownloads 3 has been ended
Since 17 August 2023 Joomla.org has discontinued support for Joomla 3.x. Therefore, we will no longer offer official support for our Joomla 3 jDownloads version 3.9.x from January 2024.
Please update your website to the latest Joomla version (Joomla 4 or Joomla 5) as soon as possible. Afterwards, please update jDownloads to the latest published version. The longer you delay, the more difficult the upgrade process for your website is likely to be.

Main Menu
Support-Forum

Error with Upload directory path

Started by lekamotu, 16.10.2014 05:28:19

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lekamotu

I have issues with the path to where jDownloads are uploaded. I have a component jDownloads and its Upload directory path should be /home/jngcompu/test/jdownloads instead of /home/auditgov/test/jdownloads
  •  

Arno

#1
Hi,
the upload folder should be a other as your joomla installation?

The folder is builded and set by installation process. So it should be the right folder, or not? So what exactly is here the 'error'?
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

ColinM

Sounds to me you have 2 test sites
home/auditgov/test/ and home/jngcompu/test/
jDownloads creates the directory jdownloads in the site's root directory.
Maybe you installed jDownloads in the wrong site?

Colin
Colin M
  •  

bositman

I am getting this bug as well. If you somehow set a Upload directory path with a / at the end of it, it is impossible to change it to something else through the jdownloads configuration (except if you directly change it in the database).
I get this error:
Error

Error! Can not rename or copy the root folder: C:/wamp/www/test/jdownloads/ to: C:/wamp/www/test/jdownloads (happened in wamp as well as a linux server)

This can easily happen when you restore from a localhost to a live server, or from one server to another using Akeeba Backup.

This also blocks you from changing anything else in the configuration options
  •  

Arno

Hi,
QuoteIf you somehow set a Upload directory path with a / at the end of it
Why will you do this? It is not possible (and not required).
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

bositman

Well it seems it's a general bug with finding the path you input. For example I got a backup from my live website with akeeba and restored it to my local wamp.
Obviously, the path is still set at the server one. If I try changing it to D:/wamp/www/test/jdownloads which is my actual path now, I can't and get an error "Error Upload root folder not found!"

Sorry I can't give you any more detailed steps to reproduce.
  •  

ColinM

@Arno
I forced the jdownloads root to have a trailing / in the database This produced the sub directories like attached pic
when I did Save it produced message where <root> was the correct root dir string
Error
Error! Can not rename or copy the root folder: <root>/jdownloads/ to: <root>/jdownloads


Once done only way to undo is through the database config table.  However I could not get it to go wrong!!  Then I tried commands like
public_html/abcd//jdownloads//  with various combinations of / charactersdirectly in cPanel  - this always resulted in the correct location as if I had al;ways typed "public_html/abcd/jdownloads"
I concluded that cPanel correctly repacees any doble // with / in the middle of a directory string and ignore any trailing /

It would be useful to know what server software the problem cases were running on.

Colin

[gelöscht durch Administrator]
Colin M
  •  

Arno

#7
Hi,
this thread confused me.
Possible that i understand not exactly what is here basicly is the problem.

QuoteError
Error! Can not rename or copy the root folder: <root>/jdownloads/ to: <root>/jdownloads

1) the currently functionality whas also used in the old series. But in this was it only possible to change the (last) folder name which was used as root upload folder for jD. This must exist in the Joomla root folder.
2) in the new series it is possible to type in a full path. So maybe should we remove the (renaming/moving action?
3) when we will remove this, the user must self move or rename the folder. Maybe is this a better solution?

QuoteObviously, the path is still set at the server one. If I try changing it to D:/wamp/www/test/jdownloads which is my actual path now, I can't and get an error "Error Upload root folder not found!"
I think in your special case must you change it directly in the database config table (see pic). Or we use the suggestion above.  ::)


[gelöscht durch Administrator]
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

ColinM

This thread is also not totally clear to me either!  But I think that some people may change the location of the jDownloads Upload directory path.  Maybe one change is that they add a trailing / to the default name.  This does not seem to matter with cPanel as it ignores it.  But for other servers like Wamp it may create a 'challenge'.  Other people might think they can explicitly write any directory string even though jDownloads says directory must be in Joomla root.

So I would suggest a change that jDownloads just asks for the name of directory in Joomla root and not the full path.  That is if there is a trailing /, or multiple trailing /, these are removed first; then if there is a : or / character in the string everything preceding the last instance is also removed; and the residual checked for being a valid string for a directory name. The Joomla root part would then be added by jDownloads internally.  This would also help site to site transfers as some people might think they have to change that manually.

This may be a bit of an overkill! And it also assumes that the problems occur due to users changing the present jDownloads directory path.

Colin
Colin M
  •  

bositman

I agree that probably the best way to deal with it is preset it in the joomla root folder, and trailing slashes get removed before trying to save the path. That will probably fix all problems we encounter


QuoteIt would be useful to know what server software the problem cases were running on.

I am running ubuntu 12.04.1,Apache 2.2.22 and php 5.3.10-1 on my live server and windows 7 sp1, php 5.3.13, apache 2.2.21 on my wamp config
  •  

Arno

Hi,
QuoteOther people might think they can explicitly write any directory string even though jDownloads says directory must be in Joomla root.
This requirement was only for the old series!!!
See first pic and compare it with the second.

Quote
So I would suggest a change that jDownloads just asks for the name of directory in Joomla root and not the full path.  That is if there is a trailing /, or multiple trailing /, these are removed first; then if there is a : or / character in the string everything preceding the last instance is also removed; and the residual checked for being a valid string for a directory name. The Joomla root part would then be added by jDownloads internally.  This would also help site to site transfers as some people might think they have to change that manually.
This is the old functionality from the old series, see above.

QuoteI agree that probably the best way to deal with it is preset it in the joomla root folder,
This is the default setting after installation.

Apropos are always removed slash or backslash characters at the end from the path value by the save process.


So we have only this possibilities:

- the user has moved the Joomla installation to a other server (or to a locally xampp wampp installation)
 Here is it required to change the path complete by the user

- the user will change the path to a other folder on the current server

So i think it is the best solution, that we remove here any special action (rename or moving - see second pic). But in this case it is possible that the user must do something self. As example to rename a folder via FTP.





[gelöscht durch Administrator]
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

ColinM

Yes, removing the ability of jDownloads moving or copying is a sound approach. It is better done by FTP, the Control Panel, other utilities or whatever.  Obviously a documentation article could be written and referenced.

There are some merits in the way the older series handled things by only specifying the folder part and inserting the Joomla root.  The text could say something like the following:

"This sets the Main directory relative to the Joomla root where uploaded files are saved. By default the Main directory is jDownloads. It could be for example my-top-folder/my-downloads. This Main directory and all its subdirectories must be writeable. If you wish to change this Main directory then you will also need to move the contents of the Main directory, please see the  documentation for notes on doing this.
Main directory Status: WRITABLE "

I have deliberately emphasised and used the words Main directory several times
Colin M
  •  

Arno

Hi Colin,
sounds good for me.  ;D

I will use your text but we should add a hint that it is very urgent, before the user changes any thing in the path, to deactivate at first the auto monitoring.
Otherwise can it be that he renamed at first the foldername via FTP and goes then to the control panel to change it in the configuration. But then will all categories and downloads deactivated. Not a good way.  ;)

Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

Arno

#13
Hi Colin,
sorry but i think this is not correct:
QuoteThis sets the Main directory relative to the Joomla root where uploaded files are saved.
In this field is stored always the absolute path.

Here is my new text version:
"This sets the path to the main directory where uploaded files are saved. This must be entered as an absolute path. The given directory and all its subdirectories must be writable. If you wish to change this main directory then you will also need to move the contents of the main directory, please see the documentation for notes on doing this. Please change here only the given path when you know what you do."

What think you?

Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

SusanTaylor1279

  •