Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: Upload files not working for me - HELP!  (Read 5380 times)

Tominator

  • Newbie
  • *
  • Karma: 2
  • Posts: 45
Upload files not working for me - HELP!
« on: May 22, 2007, 08:12:49 PM »

I keep getting a "file could not be copied!" error when I try to upload anything from the sNews files page. I can ftp files into the same dirs just fine.

The directory is CHMOD 755 (i've tried changing it to 775 & 777), no luck.

.htaccess is as follows (I have no idea what this stuff is):
Code: [Select]

    php_value session.use_trans_sid 0

RewriteEngine On
#RewriteBase /
RewriteRule ^categories/$ index.php?category=categories [L,QSA]
RewriteRule ^contact/$ index.php?category=contact [L,QSA]
RewriteRule ^images/$ index.php?category=images [L,QSA]
RewriteRule ^login/$ index.php?category=login [L,QSA]
RewriteRule ^logout/$ index.php?category=logout [L,QSA]
RewriteRule ^new/$ index.php?category=new [L,QSA]
RewriteRule ^rss/$ index.php?category=rss [L,QSA]
RewriteRule ^unpublished/$ index.php?category=unpublished [L,QSA]

RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*) $1 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ index.php?category=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z0-9_-]+)/([^/]+)/ index.php?category=$1 title=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z0-9_-]+)/([^/]+)/([0-9]+)/ index.php?category=$1 title=$2 commentspage=$3 [L]
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^([a-z0-9_-]+)/([0-9]+)/ index.php?category=$1 articlespage=$2 [L]
HELP!!!
Logged

bramsyuur

  • Hero Member
  • *****
  • Karma: 23
  • Posts: 873
    • http://snews.vietbee.net
Upload files not working for me - HELP!
« Reply #1 on: May 22, 2007, 08:47:27 PM »

Can you check if your php installation (or your hosting provider) is set to permit file upload through php?
More information could be good to see if the problem come from another way... please, provide php version, apache version... or any information that you have from your environment.
And, If you're running sNews 1.6, please, remove your current .htaccess (yours it's from a old version) and use the provided in the .zip package.
Logged
La comunidad sNews en tu idioma!
Comunidad sNews en Espaņol

Tominator

  • Newbie
  • *
  • Karma: 2
  • Posts: 45
Upload files not working for me - HELP!
« Reply #2 on: May 22, 2007, 09:00:06 PM »

Sorry, i just realized I'm running 1.5.31. It's got some custom features done by a 3rd party that would be tough for me to redo.

1. PHP file uploads - I would assume so since I also run Joomla which does it through PHP.

2. PHP version = 4.4.4

3. Apache version = 1.3.37 (Unix)

Tom
Logged

bramsyuur

  • Hero Member
  • *****
  • Karma: 23
  • Posts: 873
    • http://snews.vietbee.net
Upload files not working for me - HELP!
« Reply #3 on: May 23, 2007, 01:16:32 AM »

I've discovered a solution in some cases that the php command "copy" doesn't work due to a server restrictions.

If you change the "copy" command located on "function files()" of your snews.php file (only you need to change one matches) to "move_uploaded_file" your problem is solved!  :D
Logged
La comunidad sNews en tu idioma!
Comunidad sNews en Espaņol

Tominator

  • Newbie
  • *
  • Karma: 2
  • Posts: 45
Upload files not working for me - HELP!
« Reply #4 on: May 23, 2007, 05:12:47 AM »

OK I upgraded to 1.6 and copied the modified code over from 1.5. Seems to work. Also, that seems to have fixed the file upload / delete problem too. YAY. However, I noticed that the "View Files" function does not list ALL the files in the directory. PDFs, PHP, etc. don't show up. Any thoughts?
Logged

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Upload files not working for me - HELP!
« Reply #5 on: May 23, 2007, 07:42:55 AM »

yep.
look in // LANGUAGE VARIABLES
and find
Code: [Select]
$l['file_include_extensions'] = 'php,txt,inc,htm,html'; // list of file types available for inclusion routine
$l['allowed_files'] = 'php,htm,html,txt,inc,css,js,swf'; // list of file types available for upload/file list routine
$l['allowed_images'] = 'gif,jpg,jpeg,png'; // list of image types available for upload/file list routine
$l['ignored_items'] = '.,..,cgi-bin,.htaccess,Thumbs.db,snews.php,index.php,style.css'; // list of files&folders ignored by upload/file list routine
adjust to suit your requirements.
Logged
Of all the things I have lost, it is my mind that I miss the most.

Tominator

  • Newbie
  • *
  • Karma: 2
  • Posts: 45
Upload files not working for me - HELP!
« Reply #6 on: May 23, 2007, 07:51:53 AM »

And on another weird note, sNews does NOT like to upload files with uppercase extensions. For example, myphoto.JPG will fail. myphoto.jpg will upload.
Logged

piXelatedEmpire

  • MIA
  • ULTIMATE member
  • ******
  • Karma: 37
  • Posts: 1401
  • currently MIA
Upload files not working for me - HELP!
« Reply #7 on: May 23, 2007, 08:07:01 AM »

Thats correct Tominator, if you want to upload extensions in UPPERCASE, add them to the above snippet provided by philmoz.
Logged
my apologies to the sNews crew, but I will be MIA for the forseeable future

restoi

  • Newbie
  • *
  • Karma: 0
  • Posts: 4
Re: Upload files not working for me - HELP!
« Reply #8 on: October 25, 2007, 09:23:24 AM »

good thread.
Language Variables section is really useful.

Was unable to add pdf files and found this thread really useful.

Thank you guyz!  :)
Logged