Page 1 of 1

Uploading executes on local but not remote client how come?

Posted: Fri Oct 08, 2010 11:23 am
by sinnister
Hey guys,

I'd been working on sortta school project for the last month or so and I found a php script for uploading data and it worked fine when I tested it on my own pc (using xampp). So I continued and made all the changes to it that I wanted, and when I'm so close to release I say "hey I haven't really tested it on remote host". I upload the files to free host and I find that I can select files, click the upload button but nothing happens after that. No error messages, nothing.

The site is working perfectly when executed from http://localhost/ or http://127.0.0.1/, even my local router ip. From remote clients the web site is perfectly visible but the script just won't upload files. Just the same as remote host.

Here's link to the remote host place http://bdsat.comyr.com

On my pc I have xampp running under win xp and the above has got:
Apache ver.2.2.13 (Unix)
PHP version 5.2.*

Both got the same symptoms. I'm using this: http://www.evoluted.net/community/code/ ... isting.php script for the uploading.
And here's the exact one I'm using with very minor modifications http://pastebin.com/04E2qKJJ

Furthermore, what I managed to squeze as information is that if I change error_reporting(0); to error_reporting(E_ALL); some errors do pop up on the web page:
http://pastebin.com/AJdWn9pW

I bumped my head in the wall for past 3 days. I would be very appreciative of any help.
Regards.

Re: Uploading executes on local but not remote client how co

Posted: Fri Oct 08, 2010 11:33 am
by twinedev
my first thought would be, does the directory you are placing the files into on the server have write permission by the apache user?

Running on a local windows machine, it can probably just write anywhere.

Using a FTP program , try setting the permissions on the directory that will hold the files to be world (other) writeable.
(you will also want to then check file extensions, make sure they are not of anything other than what you are expecting, other wise someone could upload a .php file that they can run.)

-Greg

Re: Uploading executes on local but not remote client how co

Posted: Fri Oct 08, 2010 11:40 am
by Jonah Bron
Those errors are trying to tell you what the problem is.

Errors 1-9: Your script tries to access a lot of $_GET vars (and $_FILES) without checking them with isset().

Error 10: split is depreciated, use explode().

Errors 11-13: More unchecked $_GET vars

Error 14: File not existent. Probably when trying to more the uploaded file.

Error 15: Not sure, but I think it is related to error 14.

Now: you say nothing happens. Is the action on the form set to the same page? What errors do you see after submitting the form?

Re: Uploading executes on local but not remote client how co

Posted: Fri Oct 08, 2010 7:48 pm
by sinnister
File permissions was a good idea that I hadn't done much experimenting with. Thank you for that. But unfortunately even after running the filezilla server and logging into it, then changing those settings didn't help. At least not on my local machine (accesing it via proxy). The free host I'm using is aperantly checking my website for chance of it being phishing site or w/e so I can't quite do tests with it atm but will do later.

@Jonah BronWith setting error_reporting(E_ALL); I did try to upload a file (through proxy again) and I got those errors: http://pastebin.com/XZUe0bfU
To be honest this kind of problem speaks nothing to me and I really can't interpret the information I'm getting through this error reporting =(

If any of you is really interested in helping me figure this out I could pm my personal ip and may be even give you ftp access so that you can brainstorm over this. I really need it to work asap.

Thank you <3

EDIT: Oh my god, they just let go off my free host site and it seems changing permissions worked there. I read somewhere that it might be might windows that's giving some problems when setting permissions or my ftp server or I dunno. The most important thing is it is working, so when I actually pay for real host and domain I would know what might be a possible problem.
I feel so relieved :p Thank you once again hehe.