PDA

View Full Version : [fixed] Attachment problems



cdaniel
Sun 1st Jul '01, 12:57pm
I just tried attaching a file to a post. I used the "browse" function to pull it off my hard drive. When I submitted the post, there was nothing in the post itself that indicated an attachment. However, when I looked at the thread listings, there was a paper clip there. How does this work?

What I had expected was to actually see the image inline at the end of the text of the post. Is there a way to do that?

If so, is there a way to include more than one image? After the post, when I go to edit the post, the attachment option isn't there to add a second image.

I just now tried attaching it from the server instead of locally from my hard drive and that didn't make any difference.

Steve Machol
Sun 1st Jul '01, 2:03pm
Are you talking about this forum or your own? If your own, what's the URL so we can check it out.

Is it possible you have attachments set to moderate?

cdaniel
Sun 1st Jul '01, 3:07pm
On my site at http://forum.portraitartist.com/

Steve Machol
Sun 1st Jul '01, 3:22pm
I looked but didn't see any thread listing with the 'paper clip'.

Did you check to see if the attachment is moderated like I suggested?

cdaniel
Sun 1st Jul '01, 4:09pm
I double-checked and attachment is not moderated. You can see attachment paper clip here:

http://forum.portraitartist.com/forumdisplay.php?forumid=8

But, when you click on the message, there's no image.

Steve Machol
Sun 1st Jul '01, 4:22pm
What kind of an attachment was it? It has to be a valid extension type as defined in your Admin CP.

How did you check the moderation queue? It should be at:

http://forum/portraitartist.com/mod/

cdaniel
Sun 1st Jul '01, 4:48pm
I didn't know about the address http://forum.portraitartist.com/mod. I only knew about http://forum.portraitartist.com/admin. I had checked in there to make sure I had selected for attachments to not be moderated. It was fine.

However, I just went now went and checked the address you gave me and when I clicked on Moderate New Attachments, there was nothing there.

The file is a .jpg file and within the specifications in size.

Steve Machol
Sun 1st Jul '01, 5:07pm
I'm really stumped then. Maybe one of the more experienced folks can figure out what's wrong.

cdaniel
Sun 1st Jul '01, 5:36pm
to get the attention of the more experienced folks?

Mike Sullivan
Sun 1st Jul '01, 5:40pm
Server details: OS? PHP running in safe mode? PHP version? (You can find a lot of that info by going to .../admin/index.php?action=phpinfo)

cdaniel
Sun 1st Jul '01, 5:46pm
This means little to me. Does it give you any clues?

System - Windows NT 4.0 build 1381

Build Date - Apr 30 2001

Server API - ISAPI

Virtual Directory Support - enabled

Configuration File (php.ini) Path - C:\WINNT\php.ini

ZEND_DEBUG - disabled

Thread Safety - enabled

cdaniel
Sun 1st Jul '01, 5:48pm
PHP Version is 4.0.5 and safe mode is off.

Mike Sullivan
Sun 1st Jul '01, 8:31pm
As I suspected.

Try making the code change I suggested on the 2nd page of this thread:
http://www.vbulletin.com/forum/showthread.php?s=&postid=133572#post133572
(if that anchor works correctly, you'll have to scroll up)

cdaniel
Sun 1st Jul '01, 10:13pm
Are you referring to all of the 2nd page, or just the last post you made? If you're referring to all of the 2nd page, I don't know if all those things are within my capabilities and what do I do then? It's for a business site and I really need the attachment feature.

I also found these two posts elsewhere on this forum:

For attachments to work, your hosting company will have to properly setup safemode
file transfers for you.

Ask your host to set up the
upload_tmp_dir value in php.ini
if set correctly it will work with safe mode off.

I need the easiest solution possible please. :(

Mike Sullivan
Sun 1st Jul '01, 10:25pm
Right now, I guess you have 3 options:
1. Wait until 2.0.2, where the fix in #3 is implemented
2. Turn off magic_quotes_gpc in your php.ini (should be C:\WINNT\php.ini )
3. Look for the line in black in both global.php's (in the main and admin/ dirs) and add the lines in blue above it:


if (isset($attachment)) {
$GLOBALS['attachment'] = addslashes($GLOBALS['attachment']);
}
$GLOBALS=stripslashesarray($GLOBALS);

chrissmit
Thu 5th Jul '01, 2:58am
I tried that and I get this error when i post a message


Warning: Unable to create '/temp/3stars.gif': No such file or directory in ./admin/functions.php on line 1323
Warning: Unable to move 'C:\phptemp\php11E3.TMP' to '/temp/3stars.gif' in ./admin/functions.php on line 1323



=(((((((

what do I do now?
im gonna try and change it back to its original state....


-----


oh man... just had a close call, one of the scripts didnt work anymore... ended up I found the little bit of garbage i found I left behind from trying to get the attachement upload to work... phew :)

cdaniel
Thu 5th Jul '01, 7:18am
When will 2.0.2 be out and will license holders all be notified?

cdaniel
Thu 5th Jul '01, 1:14pm
Right now I see this code in the main global.php:


if (get_magic_quotes_gpc() and is_array($GLOBALS)) {
$GLOBALS=stripslashesarray($GLOBALS);
}

Are you saying it should look this this?

if (get_magic_quotes_gpc() and is_array($GLOBALS)) {
if (isset($attachment)) {
$GLOBALS['attachment'] = addslashes($GLOBALS['attachment']);
}
$GLOBALS=stripslashesarray($GLOBALS);
}

Sorry, I don't do this kind of code and I'm not real sure on the brackets.

When is 2.0.2 coming out?

Mike Sullivan
Thu 5th Jul '01, 1:19pm
Yes, that's fine.

And I don't know -- soon most likely.

cdaniel
Thu 5th Jul '01, 2:14pm
My ISP says the following. Any feedback on this? Does it sound like he did the right things? Duhhh, I feel real stupid on all this. Is there somewhere in the admin area where I'm supposed to specifiy an upload directory?

I changed the PHP file to include an upload directory, and I'm not certain what else is involved. I've setup the upload directory, and uploads are turned on in the PHP.INI file. I'm not certain what else is needed - if I was I would do so....

Without an upload directory I would doubt anything could be uploaded, which was why it was
changed.

The "magic_quotes_gpc" has to do with the setting of cookies. It has now been changed but be
forwarned if our other client who is heavily using PHP needs them on we have a dilemma.

Steve Machol
Thu 5th Jul '01, 2:17pm
I'm not sure this is the same thing, but try the Upload Options in the CP:

Admin CP -> Change Options -> Upload Options

cdaniel
Thu 5th Jul '01, 11:26pm
Ok, I'm getting some images now, but here is what my tests show:

1. On new post, I can attach one image, but it only works when I "browse" from my hard drive.

It doesn't work if I put a url in there. Is this correct?

And, is there no way to attach multiple images at a time? I tried putting in multiple paths at the same time, but no go.

2. When I go to "edit" a post that already has an image, the options are keep current, delete current or upload new...all mutually exclusive.

What if I want to keep the current and upload a new image also. Doesn't seem this is possible, but can't figure out why it wouldn't be.

3. If a make a new post with no image at all and later want to add an image, when I go to "edit" the post, no attachment options are available. As it stands now, I'd have to add a new post to get the attachment in. This doesn't seem correct.

Is the maximum file size I specified in "option" for a single file, not the total of all files?

Steve Machol
Fri 6th Jul '01, 12:43am
1. 'Attaching' a file is different from referencing an image at another URL. To do the latter, you use the [ img] [ /img] vBcode tags.

2. That's the way it currently works. Each message can only have one file attached to it. Since many people have asked for this, I suspect multiple attachments will be added in a future upgrade.

3. That's just the way it works right now.


And lastly, since you can only attach one file, the 'maximum' size is for that file only.

cdaniel
Fri 6th Jul '01, 1:09am
Oh, I see. I just tested it and it just puts the link to the image rather than putting it inline in the message. Inline is what I wanted.

So, what's the difference between

[URL] and [IMG] since they both refer to a url? Or am I missing something?

I also had a question about editing a post that had no attachment. Seems you can't add an attachment to an existing post that has none...no attachment info comes up on editpost.

Steve Machol
Fri 6th Jul '01, 3:26am
My #3 above is the answer to your third question.

And I've never thought about the difference between [url] and [img]. I assume [img] only works with URLs with valid image files. I'm not sure if [url] works with images though. It would be easy enough to test.

Inline vs. in message viewing of images is adjustable in your Admin CP. Look under 'Change Options'.

cdaniel
Fri 6th Jul '01, 11:09am
So, ok...an [img] statement allows an image inline in the message. So, why did I ever need the attachment? What's the difference? All I ever wanted was for images to be able to be included in the message. :rolleyes:

Steve Machol
Fri 6th Jul '01, 2:17pm
You really need to start looking at the Change Options section of the Admin CP. ;)

Admin CP -> Change Options -> Attachments -> View Images (yes/no)

cdaniel
Fri 6th Jul '01, 2:23pm
What you referred me to is for "attachments" not the [img] vB code: Admin CP -> Change Options -> Attachments -> View Images (yes/no)

I already had that checked as "yes" a long time ago.

What I had to change for [img] to show up was in each forum as follows:

Admin CP -> Forums & Moderators -> Modify -> Allow BB IMG Code in posts

Selecting "yes" did the trick.

Still not clear on the difference between an attachment and using the [img] command, except with the [img] command, you can include more than one image, which is what I prefer.

When would I use one over the other? ;)

Steve Machol
Fri 6th Jul '01, 2:31pm
I don't know. Good luck! :)

tubedogg
Fri 6th Jul '01, 4:36pm
Attachments really aren't meant for images and allowing image attachments is in fact extraneous because of the [img] tag. Attachments are meant for other types of files that can't be included inline.

cdaniel
Sat 7th Jul '01, 2:45pm
Thanks for clarifying. All this time I've been trying to get attachments working and all I really needed was the img tag!

Thanks! :p