user files
BUG: Files uploaded to wrong folder (9 posts)

  1. derebo
    Posted 4 years ago #

    WP 3.1.3
    Private Files 0.40

    I've uploaded a file for a given user from Manage Files dashboard column menu (Add Files) option. Manage files correctly displays the uploaded file.

    However, dashboard Your Files shows the following error:

    Warning: opendir(/home/www/website.com/wp-content/uploads/file_uploads/1) [function.opendir]: failed to open dir: No such file or directory in /home/www/website.com/wp-content/plugins/user-files/user_files.php on line 556
    You have no files

    I've created a page that displays the user files where the following code has been added to the page:

    Warning: opendir(/home/www/website.com/wp-content/uploads/file_uploads/1) [function.opendir]: failed to open dir: No such file or directory in /home/www/website.com/wp-content/plugins/user-files/user_files.php on line 480
    You have no files

    I have checked out the file structure in the server and the folder that has actually been created is:

    Yes, number 2, so obviously, the above errors are displayed? Any chance to get this fixed?

    By the way, here's my suggestion to improve this very cool and much useful plugin: Manage files should display login name apart form real name and email. It'd be more convenient when having to access the user profile.



  2. derebo
    Posted 4 years ago #

    One more thing, folder "2" has 777 permissions... Shouldn't it be at least 755? For security's purpose.


  3. Scriptonite
    Plugin Author

    Posted 4 years ago #

    Thanks for the feedback. The warning message has been fixed and the fix will be included in the next release. Also added will be categories, click to download icon, icons, and more. I have been really busy and have not had time to finish the updates.

    I haven't tested the permissions with 755, I can see if it will work properly there is no reason why they can't be.

    2.0 was scheduled for release at the end of this month but it may be mid-July now before it is ready.

  4. jvandelaar
    Posted 4 years ago #

    This is a pretty awesome plugin! Will be looking forward to the new version.

    Resolving those errors will be very handy.

    Found out that you can upload a heap of files via FTP to any specific folder in the file_uploads folder.

  5. dev123
    Posted 4 years ago #

    Hello everyone,

    I am using wordpress 3.2.1 and userfiles plugin (2.0.7). The files are getting uploaded from admin and user end fine with full content. User can see their files on the list. But, when a user clicks on "Download" option, the file gets downloaded without any content (File size is displaying 0 byte). The admin also faces this problem. Also, admin or user can not delete the file by clicking on "Delete" option.

    Please help me on this or let me know what i have to do. I was going through the functions.php file for a solution. Not yet succeeded.

    Thanks in advance.

  6. Scriptonite
    Plugin Author

    Posted 4 years ago #

    Is the file the correct size on the server or does it corrupt the file when it uploads?

    Are you running PHP 5?

    Also, what other plugins are you running? It seems like there may be a conflict.

  7. dev123
    Posted 4 years ago #

    Yes, the file is correct size on the server. Its not a corrupted file.

    And , also i am using PHP5.

    I am using the following plugins:

    1) Featured Articles Lite
    2) Cforms
    3) Flexi pages widget
    6)Wp user registration.

    I also tried on a new wordpress site. This is a fresh install of WP 3.2.1 and installed only one plugin that is User files 2.0.7 . And found the same issue.

    I was going through the files and fixed few issues.

    1) Delete file (for user):

    On functions.php file i edited the manage_files_function function.
    Added $file_path=$upload_dir['basedir'].'/file_uploads/'.$current_user->ID .'/'.$_GET['deletefile'];

    And called the variable on unlink.

    Thats it and fixed the issue. Though, it should work as you coded it earlier. But i have no idea why it was not working.

    2) Download of files (for normal user) :

    Modified this two lines on functions.php (line 40)

    $dnlLink = curPageName().'?page=manage-files-user&theDLfile='.$Thefile;
    $DelLink = curPageName().'?page=manage-files-user&deletefile='.$Thefile;


    On user_files.php modified function getDownloads() .

    Firstly, the if condition was wrong . It will be if(!$file) ..

    Secondly, inside the else of above if loop add this .


    And call that on readfile($full_file_path);

    Also i am not using this header('Content-Length: ' . filesize($file)); as its returning 0 bytes each time.

    thus the user can download the files.

    I am working on Admin download option. If i succeed i will post the procedure.

    Thanks a lot for this plugin and your help.

    Also, if you found a better solution please post and help me to fix on admin.

  8. Scriptonite
    Plugin Author

    Posted 4 years ago #

    I fixed a typo in an update this morning, I will look at the admin area this afternoon and see if I can find the issue. I will add in these changes this evening and release another update. Thanks so much for tracking down these issues.

  9. dev123
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • user files
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic