1
benlau
File uploader - strange code
  • 2004/4/26 4:49

  • benlau

  • Just popping in

  • Posts: 29

  • Since: 2004/3/7 1


Hi,

I am not sure is it the right group to ask the question. If you think it is better to ask in another group , i can repost it.

I got the file uploader module(1.1) from that page.

https://xoops.org/modules/news/article.php?storyid=1364

However, I found that it doesn't work in my system. By the result of reading the code , I know the reasons:

- It need register_global to turn on. (Hmm... but i think it is recommended to turn off..)
- the line of move_uploaded_file() in index.php is wrong.

The original line:
: if (!move_uploaded_file($userfile, "$destination/$userfile_name")

My modification:
: if (!move_uploaded_file($userfile['tmp_name'], "$destination/$userfile_name"))

I am quite confused with that module.. I want to patch it to work in my system(the system admin may not be agree to turn on register_global)

For the first problem , should it be rewrite to work in register_global off?

The last one... It is quite strange. According to the description of move_uploaded_file , the first argument should be the "name of the file". It don't accept an array.
But why the module work fine in somebody's system..


2
benlau
Re: File uploader - strange code
  • 2004/4/26 4:53

  • benlau

  • Just popping in

  • Posts: 29

  • Since: 2004/3/7 1


ohohohohoho. I made a mistake there. I have extraced $HTTP_POST_FILES. The code work fine if register_global has turned on.

Login

Who's Online

239 user(s) are online (137 user(s) are browsing Support Forums)


Members: 0


Guests: 239


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits