Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Uploading files fails
#1
Hello everybody,

First let me thank you very much for this great simple CMS! I just love it.

Anyway i have a problem:

(using latest 1.71)

When i try to upload a file nothing happens. It does not appear in the files section.
The backend gives me a link, but this does end in an internal Server Error.

I found this in the logs:

Code:
[Thu Nov 12 14:58:25 2009] [alert] [client 87.143.154.238] /var/kunden/webs/webname/data/.htaccess: order not allowed here

[Thu Nov 12 14:59:13 2009] [alert] [client 87.143.154.238] /var/kunden/webs/webname/data/uploads/.htaccess: allow not allowed here

Here my .htaccess files:

data/.htaccess:
Code:
Deny from all

data/uploads/.htaccess:
Code:
Allow from all

<Files *.xls>
ForceType applicaton/octet-stream
</Files>

<Files *.csv>
ForceType applicaton/octet-stream
</Files>

For sure, i tried changing to Allow, fileendings and so on... but same problem.

Do you have any suggestions about that?
I mean it is a default install (shouldn't that work?)

Could it have something to to with OpenBasedir or PHP Safemode (both enabled)?
Reply
#2
It could.... but i know that I don't have the upload error on any of my installs.
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#3
I can't upload any image too
I can browse for file but there is no SUBMIT button below BROWSE form
Using latest 1.71

[Image: file.png]
Reply
#4
and I am the next one who can't upload images with 1.71.

PHP 5.2.0-8+etch10, Apache 2.2.0
Reply
#5
I already contacted Chris about this before (Email sent: Nov 7, 2009 8:00 AM).
It seems to again be a problem with certain servers only. Could everyone post back with what server environment they are using?

I'm running WampServer Version 2.0
Apache 2.2.11
PHP 5.2.8

Don't seem to have upload problems with GS 1.7
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#6
I am using up-to-date Debian Etch.

Apache 2.2.3-4+etch10
PHP 5.2.0+dfsg-8+etch15
MySQL 5.0.32-7etch11
Reply
#7
@GetSimple.RU - there is no submit button - it uploads successfully, and by the looks of the screenshot - it loaded just fine

@Everyone else - 1.71 upload problems were caused by the "fix" that i put in place to stop an Uploadify ajax vulnerability. I basically put in code so that that the back-end ajax file couldn't be called directly. Look at the top of inc/upload-ajax.php to see what I mean. If anyone has a better idea I would be more than happy to implement it.
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#8
ccagle8 Wrote:If anyone has a better idea I would be more than happy to implement it.
Wouldn't it be possible to check whether the user has an authenticated admin session? That way external calls to the AJAX would be blocked as those people are not logged in to GetSimple when using it.

Haven't looked into administrator session on the GetSimple source yet, if I find time this week I will. I think that will solve everything as every server would support it (otherwise you wouldn't be logged in to the administration interface in the first place).
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#9
I vote for something like this!

Okay i mean non working upload function is not that bad (can upload and set myself) but if it would be fixed in a future release i would be happy about that!
Reply
#10
I did try that originally but i had problems with absolute/relative paths.

I need to find out how to use DEFINE() to set a global variable that always gives me the same (and correct path). If you look thru a lot of the code, I am constantly doing things like '../../data' -- always trying to keep things with a relative path. This works if you always use the file the same way, but as soon as you try to include one script into another script in a different folder, the '../../' (relative paths) no longer point to the correct place. uugghh

I have no idea if that makes sense to anyone... hopefully it does and then someone can point me to the right direction I need to go...
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#11
ccagle8 Wrote:@GetSimple.RU - there is no submit button - it uploads successfully, and by the looks of the screenshot - it loaded just fine

It shows but there is no uploaded file
Reply
#12
ccagle8 Wrote:I have no idea if that makes sense to anyone... hopefully it does and then someone can point me to the right direction I need to go...
The problem made sense to me, don't know how much help that is as I am a front-end developer and can't say how you could go with the DEFINE().

I'll be taking a look into this myself for a bit. Might I actually figure out something I'll be sure to report back.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#13
GetSimple.RU Wrote:
ccagle8 Wrote:@GetSimple.RU - there is no submit button - it uploads successfully, and by the looks of the screenshot - it loaded just fine

It shows but there is no uploaded file

I confirm this problem. Upload does not work with my Firefox (3.0.15 Ubuntu) but it works when I disable Flash, or with a browser without Flash. So there must be a problem with uploadify.
My suggestion would be to remove this script, to get GetSimple simpler (-;
Reply
#14
Pogodo Wrote:But it works when I disable Flash, or with a browser without Flash. So there must be a problem with uploadify.
The problem is probably still the same, I guess this fallback method does not use AJAX?
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#15
Yes, AJAX is not simple at all, and I would expect GetSimple to get simple not only for users but also for developers... and also to simply work in all browsers! (I've just discovered IE6 is not supported, I don't use IE, but I suppose some people do.)
Reply
#16
First, GetSimple is really very attractive and smart CMS. I want to congratulate and thank its creator! It was perfect for one of my projects - www.mamula.co.cc

Second, unfortunately I have exactly the same problem with file uplouds and therefore strongly hope that this problem can be overcome.

GetSimple is COOL and SMART! Good luck!
Reply
#17
ccagle8 Wrote:I did try that originally but i had problems with absolute/relative paths.

I need to find out how to use DEFINE() to set a global variable that always gives me the same (and correct path). If you look thru a lot of the code, I am constantly doing things like '../../data' -- always trying to keep things with a relative path. This works if you always use the file the same way, but as soon as you try to include one script into another script in a different folder, the '../../' (relative paths) no longer point to the correct place. uugghh

I have no idea if that makes sense to anyone... hopefully it does and then someone can point me to the right direction I need to go...

hi!

i think this an architecture problem... try to find out the depth or your current path from document root (works under windows as well):
Code:
function getDepth() {
    $doc_root = substr($_SERVER['DOCUMENT_ROOT'], -1) == DIRECTORY_SEPARATOR ? substr($_SERVER['DOCUMENT_ROOT'], 0, -1) : $_SERVER['DOCUMENT_ROOT'];
    if ($current != $doc_root) {
        $depth = count(explode(DIRECTORY_SEPARATOR, str_replace($doc_root, '', $current))) - 1;
    }
    return isset($depth) ? str_repeat('..' . DIRECTORY_SEPARATOR, $depth) : '';
}

for a "clean" document root you can set a global constant like this:
Code:
define('DOCROOT', substr($_SERVER['DOCUMENT_ROOT'], -1) == DIRECTORY_SEPARATOR ? substr($_SERVER['DOCUMENT_ROOT'], 0, -1) : $_SERVER['DOCUMENT_ROOT']);

another suggestion: upgrade to newest uploadify
Reply
#18
@head - i will have to try this... if this works, it will solve a ton of small issues with GS... Thanks so much for this!!
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#19
I can't upload any image. no "SUBMIT" button to upload image.
Using latest 1.71, MAMP 1.72, PHP 4.4.8 & 5.2.6, Apache 2.0.59.

Also tried on another server but had no luck.
Reply
#20
thkro, there is no submit button. You just use browse and it will directly start uploading. The problem now is just that it will (on most servers) not upload anything due to a security error.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#21
Yes, this does need to be fixed before I can role it out to my clients as well.
Also, I need blog capabilities. I hope no one is ashamed that I am creating a blogging platform for GS to incorporate.
Clients always want to be able to change the content of their pages, but they are unwilling to do so.

Have you ever coded in your underwear before?
Reply
#22
internet54 Wrote:Yes, this does need to be fixed before I can role it out to my clients as well.
You could roll out the normal 1.7 version, with some fixes, and simply block execution of PHP in the uploads folder. For most clients this shouldn’t give any problems and it will fix the main security problem of infiltration.

internet54 Wrote:I hope no one is ashamed that I am creating a blogging platform for GS to incorporate.
Probably not, but as GS 2 is said to have some better extensibility possibilities it might be better to wait? I myself am hoping for an easier way to put stuff in the admin panel.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#23
For the file upload issue, it is this code that breaks it.

Code:
if (basename($_SERVER['PHP_SELF']) == 'upload-ajax.php') {
    die('You cannot load this page directly.');
}

I can delete that code and replace it with a .htaccess file restriction and it works like a charm.
The problem with that is that newbies would have an issue trying to figure it out.
Clients always want to be able to change the content of their pages, but they are unwilling to do so.

Have you ever coded in your underwear before?
Reply
#24
whats the .htaccess file restriction you put in place?
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#25
<files upload-ajax.phpl>
Order allow,deny
allow from 111.222.333.444
</files>
Clients always want to be able to change the content of their pages, but they are unwilling to do so.

Have you ever coded in your underwear before?
Reply




Users browsing this thread: 1 Guest(s)