Uutiset:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu
Advertisement:

Problem with attachments.

Aloittaja hutch--, joulukuu 30, 2004, 08:36:27 AP

« edellinen - seuraava »

Trekkie101

In a notepad document, then save it as thingy.php and make sure there isnt a .txt extension and then upload it to your server space and then tell use the result.

Gray

ok, wasn't 100% sure where you wanted that uploaded to, so I stuck it up in a couple of places :p

www.hattrick-scotland.com/11.php
and
www.hattrick-scotland.com/forum/11.php

Same error message when trying to upload within the forum though.
Gray

[Unknown]

Oops, forgot the submit button :-[.

<?php

echo '<form action="'$_SERVER['PHP_SELF'], '" method="post" enctype="multipart/form-data"><input type="file" name="text" /><input type="submit" /></form>';

print_r($_FILES);
print_r($php_errormsg);

?>


-[Unknown]

Gray

OK, tried that, still doesn't work in the forums themselves.
Got the following from running that code.

LainaaArray ( [text] => Array ( [name] => lieutenant.gif [type] => [tmp_name] => [error] => 6 [size] => 0 ) )
Gray

hutch--

#24
OK, I plugged in the suggested PHP code and ran it and it produces an edit control, a browse button and a submit query button. Under it it the text "Array()".

There was nothing published to say what to do with the code.

LATER : I played with the script, selected a ZIP file from the Browse button then hit the query button and this text was displayed.

Array ( [text] => Array ( [name] => topgun1a.zip [type] => [tmp_name] => [error] => 6 [size] => 0 ) )

I ran the script from the forum root.

The last version worked correctly and uploads were normal so its something in the new version code that is different. I have the forum running on a FreBSD box that runs that last version fine, PHPBB2 fine, 1.9 gig of disk space and 5 gig a day bandwidth so its all big enough to run the forum.

Now I wonder if this is only a problem doing an upgrade, I downloaded the change file package and did all of the changes by FTP then ran the installer.

Has anyone done a full install yet with the new package and tested it ?

LATER AGAIN: I downloaded the complete installation and installed it on a subdomain and the forum comes up and runs fine but it still will not allow attachments to be posted. Same error message as before.
Regards,

hutch at movsd dot com
http://www.masm32.com

[Unknown]

Error should be 0, if you couldn't tell :P.

UPLOAD_ERR_NO_TMP_DIR == 6

Could mean permission denied.

-[Unknown]

hutch--





UPLOAD_ERR_NO_TMP_DIR == 6

This is fine but the last version did not have this problem. Does it means that the current version must have the server configured in a particular way or is there a way to modify the code so the error does not occur.

As a rough gues, the TMP_DIR appeas to be a modification of the eaier version which did as I understood write attachments directly to the attachments directory. Is there some purpose in the change ?
Regards,

hutch at movsd dot com
http://www.masm32.com

hutch--

Ok, I just became wiser, I restored the old forum files and it still will not accept attachments. This leaves only the database so is there any information of what is written to the database that is different to the old software ?
Regards,

hutch at movsd dot com
http://www.masm32.com

Elissen

it's a server configuration issue, not SMF. Contact your hosting provider to fix their tmp-directory.

Or if your host allows it, place a php.ini file in your home directory and set tmp_upload_dir to a new empty (writable) folder within your home-directory. The "bad" host mentioned before has a php.ini in their home-directory already. In that case download the file and change that value and upload it again (or edit it using cpanel)

hutch--

I can edit the php.ini that I wrote to include this line but I don't have any php reference for the correct syntax.

What is the syntax for setting "tmp_upload_dir" in the php.ini file ?

I have the php.ini in the domain name root, should it be there or in the forum root ?
Regards,

hutch at movsd dot com
http://www.masm32.com

Trekkie101

I said this right at the start

Lainaus käyttäjältä: Trekkie101 - joulukuu 30, 2004, 12:24:17 IP
I think i got it, just need someone to confirm,

in the probalematic server there is not an upload tmp dir

]upload_tmp_dir   no value   no value

but you said

Lainaus käyttäjältä: Elissen - joulukuu 30, 2004, 01:16:54 IP
my php.ini has this:
I don't think that should be the problem.


So now it turns out it is the problem  ??? Well then could you please ask your host to specify a temoprary upload directory

Gray

Gray

[Unknown]

I don't think you understand.  Let me restate a few things: (highlighting with CAPS.)

1. This is a PHP error, and would happen whether you were using SMF or ANY OTHER SCRIPT that uploaded files.
2. This probably means that your host RECENTLY changed a SECURITY SETTING on the server.

Nothing is wrong with /tmp per say, except that PHP *CANNOT PUT FILES THERE*.  The security setting change has DISABLED ACCESS to /tmp.  You can set it to ANOTHER DIRECTORY in your folder that DOES HAVE WRITE ACCESS or you can CONTACT YOUR HOST to get the problem resolved.  No matter of database changing or file reuploading will solve this.

The problem IS NOT the "no value", but rather that the VALUE SPECIFIED (default = /tmp) is not ACCESSABLE by PHP.  It must be for things to work.

-[Unknown]

Ray™

Had the same problem and had to add right permissions to c:\winnt\temp folder -- that fixed it
arcade-Only (over 800 Games)
http://www.arcade-only.com
Hand Made Ceramics
http://cbr.rranderson.com

Advertisement: