Previous Thread
Next Thread
Print Thread
Hop To
Anonymous
Unregistered
Anonymous
Unregistered
How do you remove an attachment from a posting without deleting the posting and redoing it?

I may be lacking sleep and seeing triple, but I can't seem to find it! <img border="0" title="" alt="[Mad]" src="images/icons/mad.gif" />

Any help would be appreciated...

Cheers, Bill

Anonymous
Unregistered
Anonymous
Unregistered
Not sure if you can, but can't you just edit the post, copy all the text and UBB Code in the post, delete the post, then repost it without the attachment?

Anonymous
Unregistered
Anonymous
Unregistered
This is not effective in our scenerio.
This would be OK, IF there were a higher root level in the Categories(which I have also been trying to make work <img border="0" title="" alt="[Confused]" src="images/icons/confused.gif" /> )
BUT, I need to always have the original postings available without being deleted and their sub-postings replied onto them.

Cheers,Bill

Anonymous
Unregistered
Anonymous
Unregistered
The only way to do this is to manually delete the file from the server, and clear the relevant column in the database.

I think this would be the correct query, where xxxxxx is the post number:

<pre>UPDATE w3t_Posts
SET B_File = NULL
WHERE B_Number = xxxxxx</pre>

Anonymous
Unregistered
Anonymous
Unregistered
It must be taken care of through MYSQL. You can use the code provided above. I checked through PHPmyadmin and Dave's code should work.

Chuck S
DIVE IN AND VISIT ME:
http://www.reefaquariums.net

Administrator at ReefTalk
http://www.reeftalk.com

Anonymous
Unregistered
Anonymous
Unregistered
Dave's code is awesome and what I've needed for months.

I used to keep a generic type "attachment removed" graphic, and I would rename it to the name of the attachment I wanted to remove, and upload it manually to my server.. thus when they clicked the attachement... they got my graphic instead of the real attachment.

Dave's code has been filed away. I've used it 3 times since yesterday.

AWESOME!!

Now why can't they add a little button under "editpost.php" that performs that command and labeled "remove attachment" as part of the standard release?

Anonymous
Unregistered
Anonymous
Unregistered
Dave told me that this removes the link from the database.. the file remains on your server. So you'll need to manually delete that.

Anonymous
Unregistered
Anonymous
Unregistered
Does anyone have a complete script that will remove it from the DB and delete that actual file from the system ?

I am still going to play around with what Dave has already applied...

THANKS DAVE! <img border="0" title="" alt="[Razz]" src="images/icons/tongue.gif" />


Cheers, Bill

Anonymous
Unregistered
Anonymous
Unregistered
Dave,

How does the post number relate to the actual file that is stored in the filesystem?
IE, how does the db identify the actual file?

Cheers, BIll

Anonymous
Unregistered
Anonymous
Unregistered
The post number gets added to the front of the filename.

For example : post number 4752 file would be:

4752-thefilename.jpg

Anonymous
Unregistered
Anonymous
Unregistered
Sorry, I should have looked in the upload directory <img border="0" title="" alt="[Smile]" src="images/icons/smile.gif" />

So, it's all clear now to me:
w3t_Posts.B_File holds either NULL or POSTNUMBER-ATTACHMENTname
w3t_Posts.B_Number holds the relevant POSTNUMBER

From Dave's script above:
UPDATE w3t_Posts
SET B_File = NULL
WHERE B_Number = xxxxxx

This will change the attribute to NULL for that posting so it doesn't think it has an attachment.
But, this still doesn't delete the associated attachment from the filesystem.

Can any script savvy person do the following:
Query the DB to retrieve the present value of B_File in w3t_Posts by asking you for the B_Number AND THEN run Dave's update above to set it to NULL, AND THEN use the $config['files'] variable to use the path and put the attachment name at the end of the path, as the file to delete in the script ? <img border="0" title="" alt="[Eek!]" src="images/icons/shocked.gif" />

OR, better yet...can INFOPOP make a button that will do that ?


Cheers, Bill

Anonymous
Unregistered
Anonymous
Unregistered
I'm not script savvy... but it sounds possible to me.

This should DEFINATELY be a FEATURE standard in the next version.

You should be able to click "Edit" on the post....and then click a button to "remove the attachment"... or even get creative and add or replace the attachment.

Anonymous
Unregistered
Anonymous
Unregistered
Any comment from INFOPOP on this?

Cheers, Bill

Anonymous
Unregistered
Anonymous
Unregistered
Hi Guys-

This sounds like a feature we definitely need to add. I'll make sure we put it on our drawing board for a future release. You should be able to delete or change any file attachment you upload for a post.

Thanks for the suggestion/feedback!

Ted O'Neill
CEO, Infopop Corporation

Anonymous
Unregistered
Anonymous
Unregistered
That is great...I look forward to it!

Cheers, Bill <img border="0" title="" alt="[Smile]" src="images/icons/smile.gif" />

Anonymous
Unregistered
Anonymous
Unregistered
Yeah!
Right from the CEO himself!

Thanks for being receptive to feedback. You certainly have superior products as a result.

Anonymous
Unregistered
Anonymous
Unregistered
This is the fasted and most efficient support I have ever seen for a piece of Software!

Great Job to the ENTIRE TEAM <img border="0" title="" alt="[Cool]" src="images/icons/cool.gif" />

Cheers, Bill

Anonymous
Unregistered
Anonymous
Unregistered
[quote]Originally posted by Dave_L:
The only way to do this is to manually delete the file from the server, and clear the relevant column in the database.

I think this would be the correct query, where xxxxxx is the post number:

<pre>UPDATE w3t_Posts
SET B_File = NULL
WHERE B_Number = xxxxxx[/code]

Warning: Stupid newby question! <img border="0" title="" alt="[Wink]" src="images/icons/wink.gif" />

In PHP Myadmin would you just enter those lines one at a time, pressing return after each one to execute them?

Da LAN Tech

Anonymous
Unregistered
Anonymous
Unregistered
dalan,

Type it as one unique string and then press enter to execute. You won't want to try to execute it between lines as shown as it's not a complete query until you are done with it <img border="0" title="" alt="[Smile]" src="images/icons/smile.gif" />

Regards,

Brett Harris
Infopop Corporation

Anonymous
Unregistered
Anonymous
Unregistered
What is this program?
I usually log right into the mysql db and query, etc....
Is this a web-interface to mysql ?
Is it safe, security wise, if your server is on the internet?

Cheers, Bill

Anonymous
Unregistered
Anonymous
Unregistered
http://www.phpmyadmin.net/

Yes, PHP MyAdmin is a web-based MySQL administrative tool. I've used it on a limited basis and have found it useful.

I don't know enough about PHP MyAdmin to comment about the security.

Anonymous
Unregistered
Anonymous
Unregistered
I can't seem to get the demo to work to see what the interface looks like?

If the site itself has issues with the tool:
<SNIP>
Live Demo (may sometimes be broken)
</SNIP>

This tends to push me away...

Anybody know where I can see a demo of the interface to see it???

Thanks.

Cheers, Bill

Anonymous
Unregistered
Anonymous
Unregistered
I use phpMyAdmin, and can affirm that it's a worthwhile tool. It's free, and not difficult to install, so you won't lose much by trying it out.

It is a potential security risk. The documentation explains two or three methods to protect it. I put it in a password-protected directory, and also used a randomish directory name to make it hard to find.

phpMyAdmin assumes that you already know how to use MySQL. It just provides a GUI for accessing the database(s).

You have to be careful using it. It's easy to change or delete content from the database with a click or two.

Anonymous
Unregistered
Anonymous
Unregistered
If you had direct SSH access to the server in which both UBB.threads and the MySQL DB were on, would you still use this tool?

Just curious if you/others use it for access purposes..IE;on ISP's servers, or purely for it's interface/ease of use?

Thanks for your time.

Cheers, Bill

Anonymous
Unregistered
Anonymous
Unregistered
I do have direct SSH access to the server.

I use both phpMyAdmin and also the mysql command on the server.

Most of the time, I use phpMyAdmin because it's easier. And it saves me the trouble of starting up my SSH client and logging into the server.

Using the mysql command was helpful in learning MySQL, and it's essential in some situations, such as when I have the web server turned off for maintenance. It's also preferable if you're doing time-consuming operations that might result in CGI timeouts.

If you're comfortable using mysql directly, and don't feel any need for a GUI interface, then stick with it. <img border="0" title="" alt="[Smile]" src="images/icons/smile.gif" />

Anonymous
Unregistered
Anonymous
Unregistered
Thanks Dave, I'll take that into concideration and maybe give it a try after I get some other things worked out that are on the plate right now.

ALSO, While I was discussing something with Brett, he mentioned that you can see side-by-side multiple tables for comparisom...now that's something I would install for <img border="0" title="" alt="[Wink]" src="images/icons/wink.gif" />

I use multiple ssh sessions and the old ALT+TAB to accomplish this now <img border="0" title="" alt="[Roll Eyes]" src="images/icons/rolleyes.gif" />

Cheers, Bill

Anonymous
Unregistered
Anonymous
Unregistered
OK, I have given it a valid try, but I cannot see where to see/compare two databases at the same time.

Can you point me in the right direction?

Cheers, Bill

Anonymous
Unregistered
Anonymous
Unregistered
I haven't seen that feature in phpMyAdmin 2.2.6. Maybe it's in 2.3.0, which is still in beta. I suggest asking Brett. When you find out, please post it. <img border="0" title="" alt="[Smile]" src="images/icons/smile.gif" />

Anonymous
Unregistered
Anonymous
Unregistered
Dave,

I just spoke with Brett after seeing your posting and inquired about how to do this...

He said that you have to run two instances at the same time and run them side-by-side, each connected to the appropriate DB.
So it looks like I was (ASS(U(ME)))ing it was all within the one instance of the tool <img border="0" title="" alt="[Embarrassed]" src="images/icons/blush.gif" />

Appologies...

I will attempt it this way, just to see, but this is really no different than me using two SSH sessions with the old ALT+TAB again <img border="0" title="" alt="[Razz]" src="images/icons/tongue.gif" />

Cheers, Bill


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
spam issues
by ECNet - 03/19/2024 11:45 PM
Looking for a forum
by azr - 03/15/2024 11:26 PM
Editing Links in Post
by Outdoorking - 03/15/2024 9:31 AM
Question on barkrowler and the like
by Mors - 02/29/2024 6:51 PM
Member Permissions Help
by domspeak - 02/27/2024 6:31 PM
Who's Online Now
1 members (Havenofsobriety), 458 guests, and 91 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)