ATutor

Learning Management Tools







Pages:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15


Cant download uploaded files


  • 2009-03-08 15:03:11

    Cant download uploaded files

    ATutor Version:
    1.6.2. Check Latest Version.
    PHP Version:
    4.4.6
    MySQL Version:
    5.0.67-community
    OS:
    Linux 2.6.24.2.dn.p4

    I am able to upload files into File Storage in Courses that i creating as an instructor, but am unable to download. The download window comes up asking for saving destination and so on. The download finishes in less than a second. File Size is 0 KB and cannot be opened. Whatever be the file type the result is the same. In System Preferences very generous file size limits have been set.
    Currently the site is under development at http://www.leaninstitute.in/LEArN/. You can check with user admin, password admin and let me know what is wrong please.

    Regards

    Ravi
    :( [red] [/red]

  • 2009-03-09 09:14:41

    Re: Can't download uploaded files

    Hello,

    Where is your content folder located and what is the permission of it?

  • 2009-03-09 09:16:43

    Re: Can't download uploaded files

    I could be any number of reasons.

    Start investigating by replacing spaces in file names with underscores. Then upload the files and see if you can then download.

    If that's not it, try searching google for "download 0 bytes" and see if you can find any answers.

    Can you upload/download from the file manager as opposed to file storage?

    This problem is probably not related to ATutor, but rather a server setting, or maybe even a browser issue.

  • 2009-03-09 10:36:36

    Re: Can't download uploaded files

    Hi! Harris,

    Contents folder is in /home/leaninst/public_html/LEArN which is the root for the website on the server.

    Regards

    Ravi

  • 2009-03-09 10:52:36

    Re: Can't download uploaded files

    Like greg has suggested, it could be a number of reasons. If you could upload and download(0 bytes), it suggests to me that it could be a server setting problem. It could also be a symlink problem.

  • 2009-03-09 10:55:43

    Re: Can't download uploaded files

    I also checked permissions of content folder on server and set all permissions to 777.

    Situation is unchanged. I checked to see the behaviour on my localhost on my laptop computer and found it to be the same.

    All downloaded files are of 0 bytes,and download is over instantaneuously while ATutor takes time to uplad and shows a file on some 1.35 MB and so on.

    I am stumped.

    I tried doing what Greg suggested and removed spaces from filenames, but the problem remains the same.

    I want to try uploading from the server cpanel filemanager as suggested by Greg, but in which directory should I upload. I cant see any files resembling the filenames I have given anywhere in content directory.

    Regards

    Ravi

  • 2009-03-09 11:00:13

    Re: Can't download uploaded files

    public_html is generally a symlink. create a script with the following lines, place it in your ATutor installation, then open it in your web browser to get the real path to your ATutor installation. Then use that path in the include/config.inc.php file to point to you content/ directory

    [php]

    getcwd();

    [/php]

  • 2009-03-09 11:00:20

    Re: Can't download uploaded files

    ATutor renames the files after uploaded for several reasons. The actual filename is being stored in the database.

    [reply][b]In reply to:[/b]
    I want to try uploading from the server cpanel filemanager as suggested by Greg, but in which directory should I upload. I cant see any files resembling the filenames I have given anywhere in content ...
    [op]forums/view.php?fid=7;pid=16863;page=1#16875[/op][/reply]

  • 2009-03-09 11:31:14

    Re: Can't download uploaded files

    Greg, I have created a file called cont_dir_find.php and placed it in /home/leaninst/public_html/LEArN which is the website's root.
    In that file I wrote in

    <?php

    getcwd();
    ?>

    and saved it.

    Then I put www.leaninstitute.in/LEArN/cont_dir_find.php but nothing happens. Anyway I think my content directory is visblein filemanager in /home/leaninst/public_html/LEArN/content, that is what is also entered in config.in.php. When I did not do this initially I got a series of error messages. So that is the first problem I solved after migrating from localhost to server.

    When uploading from filemanager should i simply upload into /home/leaninst/public_html/LEArN/content/ . Anyway even if I upload there, will file sbe visible in filemanager. I will do this and see. I am able to upload and download files to and from my website in general without any problem.

    Regards

    Ravi

  • 2009-03-09 11:42:24

    Re: Can't download uploaded files

    I am referring to the ATutor file manager, not cpanel.

    go to:

    Manage>File Manager

    try:
    [php]

    echo getcwd();


    [/php]

  • 2009-03-09 12:09:12

    Re: Can't download uploaded files

    Hi! Greg,

    I have uploaded a file through file manager into content/file_storage/1/ which was one directory within file_storage sub directory that had a file in it.

    Now how do I see this file in ATutor?

    Regards

    Ravi

  • 2009-03-09 12:14:07

    Re: Can't download uploaded files

    You can't upload files directly to the content dir and have them show up in file storage.

    What was the output of getcwd()?

  • 2009-03-09 12:29:24

    Re: Can't download uploaded files

    Greg, thanks for clarifying. I have tried to upload file through Manage>File Manager
    I try creating a file called findcont.html and pasted the code you gave and tried to save the file:


    The following errors occurred:

    * The file cannot be saved.

    Then I try creating a new folder-


    The following error occurred:

    * The folder " bplm " could not be created.

    Then I tried to upload file by first unticking enable multiple file upload, because in that option the + Browse tab does nothing.

    The following error occurred:

    * Page cannot be found.
    and the page comes back to course home.

    What should I do now?

    Regards

    Ravi

  • 2009-03-09 13:00:10

    Re: Can't download uploaded files

    What was the output of getcwd()?

  • 2009-03-09 13:03:29

    Re: Can't download uploaded files

    I am sorry I am complete nub and dont know how to execute:

    <?php

    echo getcwd();
    ?>

    after getting into Manage > File Manager

    Regards

    Ravi

  • 2009-03-09 13:09:09

    Re: Can't download uploaded files

    FTP the getcwd() file into the top directory of ATutor, then open the file through your Web browser.

    http://www.leaninstitute.in/LEArN/cont_dir_find.php

  • 2009-03-09 13:20:08

    Re: Can't download uploaded files

    I have created cont_dir_find.php and typed in the code:

    <?php

    echo getcwd();
    ?>
    and saved it - all through cpanel directly on the server and placed it in /home/leaninst/public_html/LEArN/

    - which is the top directory of my ATutor installation on the server

    Then I executed

    http://www.leaninstitute.in/LEArN/cont_dir_find.php

    in the browser, and get a white screen and Done at the right bottom of screen.

    to login to ATutor I need to type in http://www.leaninstitute.in/LEArN/

    into the browser

    SO I have placed cont_dir_find.php at the right place I guess.

    Regards

    Ravi

  • 2009-03-09 13:30:25

    Re: Can't download uploaded files

    It does not matter where the file goes, as long as you can open it in a Web browser.

    I don't know how else to help. If you're getting a blank screen, the file is not correct. This is fairly basic stuff, and we can't really spend time helping with PHP coding. I'll point you to the reference, and you can continue from there yourself.

    http://ca.php.net/getcwd

  • 2009-03-09 13:54:55

    Re: Can't download uploaded files

    I dont know why all this is required. php programming should not be required to populate ATutor.

    My content directory is known. These are contents of file_storage in content directory


    / public_html / LEArN / content / file_storage / (Current Folder)

    Create New Folder
    Upload file(s)
    Up one level
    1 755
    Create New File
    index.html 0 k 0644

    The other files in content folder are:


    / public_html / LEArN / content / (Current Folder)
    Create New Folder
    Upload file(s)
    Up one level
    1 755
    2 755
    3 755
    4 755
    backups 755
    chat 755
    feeds 755
    file_storage 755
    hello_world 755
    import 755
    module 755
    patcher 755
    photo_album 755
    profile_pictures 755
    theme 755
    Create New File
    index.html

    So content folder location is known, which was supposed to be the output of getcwd().

    What next, after knowing where the content directory is. This same directory has been entered into the right place in config.inc.php which is to be found in
    home/leaninst/public_html/LEArN/include

    As I said before, if we do not have the right content directory defined in config.inc.php you cannot get an error free login screen.

    I request you to get into

    http://www.leaninstitute.in/LEArN/login.php
    and
    user admin
    paswword admin

    and check out once and let me know. With your expertise, you might get to know what is wrong in a minute and be able to advise me.

    Regards






    Everything else is working, why not file download in ATutor. The file is definitely getting up[loaded it seems,

  • 2009-03-09 14:42:35

    Re: Can't download uploaded files

    There's no programming. We are just trying to determine if your host uses symbolic links in paths to your Web site. This is not a problem most people experience. It has to do with the way your host is configured.

    I'm still not seeing any output from the getcwd() file you created. I need to confirm with my own eyes that public_html is not a symbolic link before we continue trying to help. While you're at it, also add the following line to the file, so we can see how your host is configured.


    [php]

    echo getcwd();
    phpinfo();

    [/php]

  • 2009-03-10 04:02:55

    Re: Can't download uploaded files

    Hi! Greg

    Here is the result of various entries in config.inc.php

    First:
    define('AT_CONTENT_DIR', '/home/leaninst/public_html/LEArN/content/');

    Manage > File Manager

    A window comes up allowing me to browse to file to be uploaded. I press Upload and wait..
    The page jumps to Course > Home

    Home
    The following errors occurred:

    * Page cannot be found.

    The rest of the Home page is as usual

    Second:
    define('AT_CONTENT_DIR', '/home/leaninst/public_html/LEArN/tools/content/');

    Manage > File Manager

    File Manager
    The following errors occurred:

    * Unable to open content directory. You may try to create it now.


    Third:

    define('AT_CONTENT_DIR', '/home/leaninst/public_html/LEArN/');

    Manage > File Manager
    File Manager
    The following errors occurred:

    * Unable to open content directory. You may try to create it now.

    In all the cases content folder permissions were changed to 777

    I hope this info help you help me

    Regards

    Ravi

  • 2009-03-10 04:08:54

    Re: Can't download uploaded files

    Output of getcwd()

    I created creating placed a file called findpwd.php with the code you gave (<?php

    echo getcwd();
    phpinfo();
    ?>)

    into top directory of my ATutor installation on my server -
    /home/leaninst/public_html/LEArN/ :

    I than ran in browser:
    http://www.leaninstitute.in/LEArN/findpwd.php


    Output:
    /home/leaninst/public_html/LEArN

    That settles the issue of output of getcwd()

    Regards

    Ravi

  • 2009-03-10 04:19:41

    Re: Can't download uploaded files

    Output of:

    <?php

    echo getcwd();
    phpinfo();
    ?>

    Please click the link:
    http://www.leaninstitute.in/LEArN/findpwd.php

    or see if required attached zip file of saved html file file:

  • 2009-03-10 09:22:05

    Re: Can't download uploaded files

    Permissions on the file storage directory seems to be the problem. Files do not appear to be uploading. If you try uploading a plain text file, then click on edit, you get the following error:

    <b>Warning</b>: file_get_contents(/home/leaninst/public_html/LEArN/content/file_storage/1/21) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in <b>/home/leaninst/public_html/LEArN/file_storage/edit.php</b> on line <b>182</b><br />

    run "ls -al" at the command prompt in the content directory. You should get something that looks like this:


    drwxr-xr-x 12 nobody nobody 4096 Dec 16 10:23 file_storage

    Then look inside the directory for another directory with the number corresponding to the course id number. Run "ls -al" again.

    Everything should be owned by the webserver users, in the case above "nobody".

    Directories inside file storage should look like:

    drwxr-xr-x 2 nobody nobody 4096 Feb 26 19:19 1

    File inside the course id directory should look like this:

    -rw-r--r-- 1 nobody nobody 65217 Feb 10 18:12 111


    If the above are not all true, you should recreate the file storage directory, set its permission to 777, or if you run chmod -R 777 on the current file storage directory (latter which is less advisable)

    Though you base Web directory is in the open_basedir, you may also need to add the path to the content directory to it. This is set in the system's php.ini file.

  • 2009-03-11 09:29:28

    Re: Can't download uploaded files

    Hi! Greg,

    Thanks for the painstaking diagnosis. I have changed permissions from cpanel on my webserver of /home/leaninst/puublic_html/LEArN/content/file_storage/ to 777, and checked.

    Later I deleted the file_storage directory and created a new directory by the same name and set permissions to 777.

    The result in both cases above is the same:

    From file storage menu file appears to get uploaded but when downloaded shows 0 bytes size.

    From file manager menu the same upload causes a return to course home with the error message "page not found".

    I will need to check with our server administrator about changes to php.ini, which I will do tomorrow.

    Meanwhile I am in a jam and can't go forward with developing my pilot course content which I was working on to serve as an example for my other instructors to follow suit.

    I have done a little bit of hacking in my life. Learning about php will not be an insurmountable challenge.

    I run a triple boot dell inspiron 1525 with Mandriva Linux 2009, OS X 10.5.6 and a fall back Windows Vista.

    OS X is my favourite OS. My Dell works just like a MacPro with all its systems operational and I am quite proud of almost kicking out windows and am enjoying all the benefits of speed and security that Linux or OS X provide.

    In the same spirit,I vow to find a solution to this problem along with you and my server administrators.

    Regards

    Ravi