English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Ok so basically I had a friend code this image uploader for me, but when I go to use it on my site which is listed below it doesn't seem to work, yet it does when he has it on his 'local machine'

Anyone help me out here please? :)

http://eflhc.co.uk/uploader.php

2007-07-09 03:47:35 · 4 answers · asked by jonxhc 1 in Computers & Internet Programming & Design

Well it checks to make sure what type of format is being uploaded and the form is for a project that I'm working on at the minute.

2007-07-09 03:57:37 · update #1

4 answers

I agree with one of the people who has already posted. It is likely that you are not uploading anything.

In your target script (which is this one by the looks of it) add this snippet of code at or near the top:

if(count($_FILES) > 0) {
echo "

\n";
print_r($_FILES);
echo "
\n";
} else {
echo "Files not being uploaded.\n";
}

This will tell you what is happening. Look on php.net for file uploads- look at the source link or go to:

http://us2.php.net/features.file-upload

Hope this helps.

2007-07-09 04:02:58 · answer #1 · answered by Tony 2 · 0 0

I just uploaded something and no error messages were returned. If it works locally, but not remotely it might be a paths issue. However, eflhc.co.uk gives me a 403 and a 404 error when I try to access it, but eflhc.co.uk/uploader.php is fine. Is this deliberate?

I see you are using Apache 2. Did your friend code in a compatible version of PHP?

What did you use to build the site? You might want to use something like Joomla, it has plenty of uploading modules.

2007-07-09 10:58:03 · answer #2 · answered by Anonymous · 0 0

I suspect it may have something to do with the action="" part of the form code.

You're not telling the form where to submit its data. So the upload isn't taking place.

Also you have two form elements with name="upload". You'll have to change them so they have unique names. Otherwise you won't be able to get the name of the file you're uploading.

There are loads of examples of PHP upload code on the net. Take a look around.

Also, be aware that having a public upload form that anyone can access is a very, very, very bad idea. Anyone could upload anything - even viruses if you don't check what is being uploaded by clients before it's accepted.

2007-07-09 10:53:27 · answer #3 · answered by Yanni Depp 6 · 0 1

It doesn't report any errors.

My best guess is that your service provider has disabled file uploads from PHP.

http://uk2.php.net/manual/en/ini.core.php#ini.file-uploads

(Incidentally, while the empty string as the value of the action attribute is a valid URL, some browsers don't understand it correctly, so I'd avoid it as far as possible)

2007-07-09 10:54:08 · answer #4 · answered by David D 7 · 0 0

fedest.com, questions and answers