News:

Dear forum visitors, if the support forum is not available, please try again a few minutes later. Thanks!

Main Menu
Support-Forum

Browser error message "This webpage has a redirect loop"

Started by Stavros, 18.12.2015 06:41:18

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Stavros

I am using jDownload Version 3.2.39 on Joomla 3.4.6 and PHP 5.5.30. It is an excellent program. Congratulations!

The program works fine. However after updating today a download file with a new copy, the downloading of that file yields a browser error message saying "This webpage has a redirect loop" (Chrome and Opera) or a browser error message saying "The page isn't redirecting properly" (FireFox). This is irrelevant of the file type (e.g. pdf, jpg). The preview images of jpgs do appear O.K. The problem appears only when clicking the "Download" button.

The problem is only on new download files and newly updated download files. All previous download files do continue to download O.K.
Please note that the latest previous update of any download file was done a few months ago (quite a few joomla, jDownloads and other plugin updates took place since then).

Can you help me? Is it possible I can downgrade the jDownloads to the previous version which did not have this problem? Thank you.
Stavros Zacharias
  •  

ColinM

Hi
Will certainly try to help.
Could you say how you did the 
Quoteupdating today a download file with a new copy


Maybe the database linkage has got upset.  As a precaution I would suggest you use the Tools- Backup option, including the log table Option.  This exports a csv version of the database.
Colin
Colin M
  •  

Stavros

Joomla --> Components --> jDownloads --> Downloads
I clicked on the title of the file in concern to enter the "jDownloads: Edit Download panel"
On the right, in the "Files Data" panel, I clicked the "Choose File", I chose the new file from my computer and then I clicked the "Save" button on the top left of the window.
After clicking the "Save" button, an uploading progress indicator appeared on the bottom which vanished when the uploading finished.

Nevertheless, because I had my suspicions of the process, I tried to insert a new file. Nope, the same problem.
I thought that maybe that particular file may be corrupt, therefore I've created a new download file for another pdf file. Nope, the same problem.
I thought that maybe a jpg file would fare better. Nope, the same problem. The photo appears fine in the preview but I get an error message when trying to download the file.
I've replaced all spaces with underscores in the file names. Nope, nothing (actually the older files have spaces in their names and download O.K.).

There must be something in the creation of a new download file or the update of an existing file that screws up the downloading function.

To have an immediate solution to my problem, I FTP uploaded the new pdf file into the jdownloads folder at my site replacing the old file with the new file with the exact same name. It worked fine. But I dread the moment I will need to add a new file.
  •  

ColinM

Hi
At least the problem has been isolated!  If you send me site admin details by PM then I will take a look to see if I can spot anything.
Colin
Colin M
  •  

Stavros

Any news?
I've sent you the access information last Saturday through private communication.

I've discovered something new. The problem and the error messages derive from the fact that when creating a new download file or when updating an existing download file, the new file is not uploaded into the jdownloads directory. I've created a new upload file and the problem appeared as explained in my previous communication.
Then, with FTP I uploaded the new file directly into the jdownloads directory and the problem disappeared. The downloading of the new file works as expected. Shouldn't jDownloads take care of the file uploading into the jdownloads directory instead of me having to do it "manually"?

The weird thing is that jDownloads creates and presents correctly thumbnails/ screenshots of the new files (image files), therefore it must be uploading them somehow but not placing them into the jdownloads directory. I don't have time now, but, later on, I will search to find where it may be uploading them into.

Thank you
Stavros Zacharias
  •  

ColinM

Stavros,
It was not until this morning that I had time to do a detailed check.

I had thought initially it was that you had set some deny permissions.  But that was not the case.

I looked in ProFil and found that you had set the root directory for that component to the images directory of Joomla! root.

Then I thought the problem is that I think someone has changed the location of the main jdownloads directory  into which the categories (directories) and the actual files part of a Download are located.

The normal location of the jD root directory is defined in Config - Downloads tab - "Upload directory path" field. It is created by jD on initial install in the Joomla! root directory. It is usually is something like '/home/site-id/public_html/jdownloads'

However in your case it is just 'jdownloads'. 

Later I looked in ProFil and found that you had set the root directory for that component to the images directory of Joomla! root. So I temporarily changed that back to the Joomla! root.  All my initial investigations were 'confused' because of that.

By using the jD root directory as just jdownloads then that directory is outside the Joomla! root, probably somewhere in the website root.  Hence there is confusion.  The Config file does suggest that the Download location should not be changed.

The solution might be quite simple except for one aspect related to the database.  The database tables for files and categories relate the file name to the file id and each category 'names' it parent so they are relative.  However each entry also has a pointer to the Joomla! assets table and that may be of concern.  If it is not then the solution might just be to set the "Upload directory path" field back to its correct location [NB the ProFil component has the correct path - need to use jdownloads in place of images when putting into  Upload Directory Path field]. 

I will ask Arno to confirm or otherwise.  I have actually spent several hours on this "challenge".  Will also PM you a log of things I did.

Colin

Colin M
  •  

Stavros

Thank you Colin for your response. We now see light at the end of the tunnel.  8)

I don't know what that ProFil is and where it is. I've searched for it to no avail.

Nevertheless, it seems that there are three "jdownloads" directories

  • in the root of the website
  • in the "/administrator/" directory
  • in the "/images/" directory
I don't remember how the "/images/jdownloads/" was declared and created but it seems that it serves the purpose of holding thumbnails and image screenshots. It doesn't matter what directory I declare in the jDownloads --> Configuration --> Downloads --> Upload Directory Path, the thumbnails and the screenshots are always created and placed in the "/images/jdownloads/" and they are used from in there. ... Fine.

I've just noticed in the "Download Configuration Notes" that the path of the "Upload Directory Path" must be absolute. After setting an absolute path, as per your advise, everything works fine. In this case, the files are uploaded into the "jdownloads" directory at root and the program downloads them from that same directory.

The problem arises when I do not declare an absolute directory path for the "Upload Directory Path". In this case, when I only set "jdownloads" in the "Upload Directory Path" the program uploads the new files into the "/administrator/jdownloads/" directory, but when the program is asked to download those files it tries to download them from the "/jdownloads/" directory at the root. It does not find the files in there and it gets confused giving us a redirect loop error message. If we later manually place those files into the "/jdownloads/" directory at the root, the program finds them and downloads them as expected. By the way, setting "../jdownloads" in the "Upload Directory Path" makes things worse since in such a case even those files which were previously downloadable become problematic.

I prefer to use relative directory paths because for each online website I maintain, I also maintain a local working copy, for development purposes. My local computer is a windows pc. I frequently restore the online site onto my local computer and vice versa either by importing mySQL database dumps or by using the Akeeba Backup.
The directory structures of the online unix server and of my local windows pc are not similar. Having to find and fix absolute directory paths after every restoration would be a nightmare.

Is there a possibility that a future version of jDownloads will allow for relative paths? Can you add it to the program's feature suggestions list?
jDownloads is an excellent product with great support and I have placed a recommending review in JED. :)

Thank You
Stavros Zacharias

  •  

Arno

Hi Stavros,
Quote
The problem arises when I do not declare an absolute directory path for the "Upload Directory Path".
in this field MUST be the absolute path. Nothing else!

See also documentation:
http://www.jdownloads.net/documentations/item/tab-downloads-2

When you try here other values, we can not give more support.
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

ColinM

Stavros,
Glad that resolved the problem.  As Arno says at the moment putting in the absolute address is essential for the download mechanism in place.  Some time ago in an earlier series I think there were numerous problems with using a relative address, and Arno is a biy wary of repeating that.  But obviously not impossible.
Anyway Happy New Year.

Colin
Colin M
  •  

Stavros

Somehow, when I don't set an absolute directory path, it looks as if jDownloads is adding the directory name "jdownloads", which I set in the Upload Directory Path field, to the Joomla constant JPATH_BASE thus creating the absolute directory path it needs.

This constant (JPATH_BASE), when used in the frontend, is the absolute directory path to the directory where Joomla is installed. In my case, that's exactly where jDownloads looks for the requested files in order to download them from; "joomla_site/jdownloads/".

However this constant, when used in the backend, is the absolute directory path to the Joomla administrator directory. Again, in my case, that's exactly where jDownloads uploads the files into; "joomla_site/administrator/jdownloads/".

Thus, we have two different directories (one for uploading and one for downloading) instead of one for both uploading and downloading.
If this is true, then the solution is simple. Instead of the constant JPATH_BASE use the constant JPATH_ROOT which in both cases (frontend or backend) will give the absolute directory path of the directory where Joomla is installed.

Of course, I don't know jDownloads inner workings in the frontend or the backend and this may be completely irrelevant. It's just an idea, if it helps.

Thank you guys for everything, and have a happy new year!
Stavros Zacharias
  •