11
DutchMan
Re: User upload
  • 2004/3/28 9:38

  • DutchMan

  • Just popping in

  • Posts: 22

  • Since: 2003/11/20


I have found it out by myself, which template i have to edit. I will give it a try.

12
tamerlo
Re: User upload
  • 2004/3/28 9:38

  • tamerlo

  • Just popping in

  • Posts: 71

  • Since: 2004/1/30


My little changes now this:

in mydownloads_submit.html I have changed the definition of form adding

enctype="multipart/form-data

and a line in html table after url entry:

<tr><td class="head">
<b>File locale:</b></td>
<td class="odd">
<input type="file" name="fileutente" />
</td>
</tr>
<tr>

after in file submit.php in mydownload module directory I have modified

// Check if URL exist
if (($HTTP_POST_VARS["url"]) || ($HTTP_POST_VARS["url"]!="")) {
$url = $HTTP_POST_VARS["url"];
}

in:

// Check if URL exist
if (($HTTP_POST_VARS["url"]) || ($HTTP_POST_VARS["url"]!="")) {
$url = $HTTP_POST_VARS["url"];
}
if (!empty($_FILES['fileutente'])) {
$file_name = basename($_FILES['fileutente']['tmp_name']);
$file_info = pathinfo($_FILES['fileutente']['name']);
# add extension
if ($file_info['extension']) {
$file_name = $file_name.".".$file_info['extension'];
}
# compose url path
$url = XOOPS_URL."/modules/mydownloads/uploads/".$file_name;

if (move_uploaded_file($_FILES['fileutente']['tmp_name'],"uploads/".$file_name)) {
$debug_txt = "File uploaded";
}
else {
$debug_txt = "Error while upload file:<br/>".$_FILES['fileutente']['error'];
}
}

This method admit that users can add simple a link or, in case that gives you a file, upload a file in a directory.

I am trying to work on automatic deletion of not approved file. Also I'm not sure that the uploaded file don't write over another file but now work

13
DutchMan
Re: User upload
  • 2004/3/28 9:38

  • DutchMan

  • Just popping in

  • Posts: 22

  • Since: 2003/11/20


I have found it out by myself, which template i have to edit. I will give it a try.

14
javier
Re: User upload
  • 2004/4/16 17:53

  • javier

  • Not too shy to talk

  • Posts: 184

  • Since: 2002/8/6 1


tamerlo these hack not check the file extensions?

i ask because if a user upload a php file with certain code, can hack the site.

grettings

15
tamerlo
Re: User upload
  • 2004/4/17 8:45

  • tamerlo

  • Just popping in

  • Posts: 71

  • Since: 2004/1/30


No, there are any type of control on extensions, but is only an idea of hack.

I only start to work this but seems, in another thread, that something is hacking the official downloads module and I'm waiting this also beacause in this period I have not much time.

16
Sebastian
Re: User upload
  • 2005/1/6 3:48

  • Sebastian

  • Just popping in

  • Posts: 23

  • Since: 2004/11/25


I'm running a website with XOOPS 2.0.6 on an Apache PHP module (I think) and I'm having this problem with the mydownloads module:

When I upload a file, either logged in as webmaster or test user, I keep running up against a barrier. Files smaller than ca 1,5 MB are uploaded; files larger than that 1,5 MB return an upload error.

I've enabled user upload, selected all listed file types as eligible for upload, I've set the maximum width and hight of uploads to 320, I've set the file size ceiling for uploads to 10,000,000 bytes, the uploads directory has been set to CHMOD 777. I'm positive I don't exceed my disk quota.

I can upload files through FTP and then add them to the database, but I'd like the users to be able to do this too. Obviously, I can't allow them FTP access :)

Also, there's another problem: When I enable admin approval for uploaded files, I can't approve them! Whn I click the approve button in the waiting files queue form, nothing changes, the file is still listed as waiting for approval. I can delete unapproved files, though, and I've verified that they are in the uploads dir as expected.

Does anyone know the cause or a possible solution to this issue?

17
m0nty
Re: User upload
  • 2005/1/6 4:50

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


this is an old thread, you should really have searched the site and modules repository..

try wf-downloads it's probably the best..

or visithttp://www.wf-projects.com

your size restriction is possibly due to the fact ur host as a max upload size set in which case it makes no difference whatsoever that u set max size to 10mb or even 100mb, u will only ever be able to upload files less than what they have set it at in your case 1.5mb

ftp uploading is completely different to http uploads..

18
Sebastian
Re: User upload
  • 2005/2/1 12:42

  • Sebastian

  • Just popping in

  • Posts: 23

  • Since: 2004/11/25


Thank you for the response. I'll ask my administrator anbout the HTTP upload.

Do you know if mydownloads files can be imported to WF_Downloads in some way, without re-adding them manually? If so, I might give it a shot.

Sorry for posting in the wrong place, it that's a problem.

Login

Who's Online

155 user(s) are online (97 user(s) are browsing Support Forums)


Members: 0


Guests: 155


more...

Donat-O-Meter

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

Latest GitHub Commits