so here i am to rant again
$location = $mybb->settings['pics_dir']; // "pics"
if(!@move_uploaded_file($input['tmp_name'], MYBB_ROOT.$location."/".$filename))
results in this damn backslash in the wrong place and the files moves to mybb root for some reason instead of going to the pics dir
C:\xampp\htdocs\mybb/pics
so im pissed hope i can get this sorted soon
Shouldn't you be using localhost in the address bar?
Or am I missing the problem, I am a little confused.
nah i was uploading the file and it kept going in the myBB root folder
so i just echo'd
MYBB_ROOT.$location."/".$filename
and instead of
C:\xampp\htdocs\mybb\pics
or even
C:/xampp/htdocs/mybb/pics
i get
C:\xampp\htdocs\mybb/pics
note the forward--forward--back--slash
Yeah, Matt said what I was getting at.
i think i might be confusing everyone
php script to upload file is at
htpp://localhost/upload.php
when i feed it using the $_FILES['picture']
it should upload it to
mybb_root/pics/pic001.gif
but instead it uploads to
mybb_root/pic001.gif
to debug my script i went back to check the variables and thought to check if it was actually pointing to the right spot to upload the file
so a small edit so that my file upload script upload.php (for testing purposes) now read
echo MYBB_ROOT.$location;
where $location is $mybb->settings['pic_dir']
and then i access
http://localhost/upload.php and the output is
C:\xampp\htdocs\mybb/pics
If it's one thing I hate, it's this.
What happens if you do:
MYBB_ROOT.$location."\\".$filename
The strange thing is, Windows has been able to handle '/' in paths for a while now. Which version of Windows are you using?
im using windows 7
and @Tomm M -- tried that
---- nada
plus what happens when someone runs it on a linux based host
DIRECTORY_SEPARATOR
You can use that constant.