Skip to:
Content
Pages
Categories
Search
Top
Bottom

Possible way to upload image to post


  • brad_langdon
    Member

    @brad_langdon

    I was reading someones post trying to figure out how to upload an image from their computer and onto the post and of course you can only attach images that are already on the net.

    Then I found this response from “chrishajer” (Moderator)…

    “I don’t think the attachment plugin is designed to allow those images to be inserted into the post with the allow images plugin. It could probably be done with a 2 step process.

    1. attach the image.

    2. grab that URL and then insert the image.

    It would be in the thread twice though, which is silly. I think it’s better to have the images stored elsewhere then have people insert them like that, nothing on your server.”

    Does anyone out there know how to do the above?

    If you could somehow upload the image to your server and then link to the URL all at once?

    I’m desperate to find a result for this.

Viewing 24 replies - 1 through 24 (of 24 total)

  • _ck_
    Participant

    @_ck_

    I added the ability for bb-attachments to insert images into a post last week. Download the newest version.


    brad_langdon
    Member

    @brad_langdon

    Thanks for that it’s a huge help.


    brad_langdon
    Member

    @brad_langdon

    I have installed it but am only getting a link to the image in my post.

    Not sure if I am doing it wrong but I am wanting the actual image to display in the post not just the link.


    brad_langdon
    Member

    @brad_langdon

    Does anyone know of a way to display attachments as actual images rather than links?


    chrishajer
    Participant

    @chrishajer

    I think rather than attachments you want the “Allow Images” plugin, where people can insert an image into their reply.

    http://bbpress.org/plugins/topic/allow-images/#post-6

    The member has to have the image hosted somewhere accessible on the Internet though ( http://imageshack.us/ or http://photobucket.com/ or http://flickr.com/ or something ). If you want the ability to host their image then display it rather than link to it as an attachment, then you might want to look into this alpha version of the attachment plugin that allows inline image viewing.

    http://bbpress.org/forums/topic/priority-1-imagefile-attachments#post-17539


    brad_langdon
    Member

    @brad_langdon

    Thanks but I have that version installed now I am pretty sure (version 0.1.7) and I am still just getting the link to the image not the actual photo.

    The Link you gave me didn’t link to a plugin but a discussion about creating one.

    I have no idea what has gone wrong…


    brad_langdon
    Member

    @brad_langdon


    chrishajer
    Participant

    @chrishajer

    I just installed the plugin and I can attach as well but not inline it. Maybe _ck_ will be along soon to explain how to inline the image.

    Does the “Allow Images” plugin not work for you do to the requirement to have the member host the image somewhere?


    brad_langdon
    Member

    @brad_langdon

    Um I don’t know really. I tried disabling the allow images plugin but it didn’t change anything.

    I saw an example of a forum with an image in it 15 minutes ago and when I checked it again it just had the attachment so I’m really confused.

    It was the example on the plugin install or instructions page which ever one it is on.


    chrishajer
    Participant

    @chrishajer

    There are two different options here.

    1. Allow Images plugin. The member needs to link to an image available in the Internet somewhere. If that’s not a problem, then that’s the way to go. It allows members to insert images into their posts. Pretty easy.

    2. Attachments plugin. This you have working as attachments now, but you want the image inline, not attached. The newest version is supposed to do that, and I just read this on the plugin page:

    After uploading, an [INSERT] link will appear next to each attachment.

    So, the user needs to upload it first, then go back and edit their post, and click the [INSERT] link. I actually just noticed that: I have the link, but it doesn’t work. It seems like a JavaScript error.

    Error: myField is not defined
    Source File: http://www.example.com/bbpress/edit.php?id=2
    Line: 76

     

    If you cannot use the Allow Images plugin, instead of the Attachments plugin, then you might want to post your concerns on the plugin page, or wait for _ck_ to show up here. The plugin was released early because a lot of people were looking for the inline functionality, and I’m sure _ck_ will appreciate feedback from anyone using it.


    chrishajer
    Participant

    @chrishajer

    I tried inserting the bbcode directly, like the JavaScript would have done (I think), but it does not appear to work either.

    [attachment="2","1"]

     

    The above just displays in the post.


    brad_langdon
    Member

    @brad_langdon

    http://harrismarine.co.nz/bbpress/topic.php?id=5

    If you click the above link you will see what I am getting.

    After I ‘insert’ the image I just get this small red bar thing showing up. It is the same red as my links I think. It is right next to the text.


    chrishajer
    Participant

    @chrishajer

    brad_langdon: I think if you want to use the Attachment plugin you will want to wait for _ck_ to pop in.


    chrishajer
    Participant

    @chrishajer

    On another note, I fixed the JavaScript error and was able to use the [INSERT] link to insert the code into the post, but this is what appears:

    [attachment=1,undefined] 

    I am guessing the undefined is part of the problem. That code still remains in the post though. I read this in the plugins page:

    (extra BBcode plugin not actually needed)

     

    I don’t have any bbCode plugin installed (I have no plugins installed actually) so I’m not sure why this bbCode is not being converted by the plugin.


    _ck_
    Participant

    @_ck_

    Hmm, did we get this solved?

    If you ever need me in a thread, tag it with _ck_ otherwise I might not see it.


    chrishajer
    Participant

    @chrishajer

    I saw your comments on the comments page and figured it was being resolved there.

    This was the last I heard:

    http://bbpress.org/plugins/topic/bb-attachments/page/6/#post-1553

    I just tried the 0.1.9 version and the JavaScript is working; it inserts the bbcode. But when I resave, the image was renamed to this:

    [png] Error_Occurred_While_Processing_Request.png (17.7 KB, 0 downloads) [x]

    And it is not inserted into the post.


    citizenkeith
    Participant

    @citizenkeith

    I have installed it but am only getting a link to the image in my post.

    After you upload and post, go back and edit the post with the image attachment. You’ll see the word INSERT. Click it…. and a direct link to the image will be added to your post. Click “Edit Post” and your post will now display the image that you uploaded.


    chrishajer
    Participant

    @chrishajer

    I just tried again on a new post, and the image is embedded into the post like it should be.

    I wonder why the earlier one failed? I did previously try to upload a bmp, and I got an error about “denied mime”. I wonder if that being there fouled up the request to insert the png?


    chrishajer
    Participant

    @chrishajer

    Here’s a screenshot of the attachment lists showing the “denied mime.”

    http://www.chrishajer.com/bbpress/attachment-mime.png

    The ordered list appears to be hanging out to the left of the #main div by a little bit.


    _ck_
    Participant

    @_ck_

    BMP is not an allowed mime by default because they tend to be huge and uncompressed. You can force it to be allowed though by adding it to the mime (and extension types).

    This bug bothers me though, if you can give me steps to reproduce it that would be very helpful:

    [png] Error_Occurred_While_Processing_Request.png (17.7 KB, 0 downloads) [x]

    Did it happen when you uploaded a PNG and a BMP at the same time?


    chrishajer
    Participant

    @chrishajer

    IIRC, I uploaded the BMP and got the denied mime. Then, at a totally separate time when uploading a PNG I got the error described here.

    I never tried to upload more than one image at a time.

    I would totally disallow bitmaps as well, since they’re really not designed for the web. I was thrown off by this note from the saying they’re allowed:

    allowed uploads: bmp (500 KB), doc (500 KB), gif (500 KB), gz (500 KB), jpeg (500 KB),
    jpg (500 KB), pdf (500 KB), png (500 KB), txt (500 KB), xls (500 KB), zip (500 KB)


    _ck_
    Participant

    @_ck_

    Oh shoot, you are correct, I allowed them in the end by default. I might remove that.

    update: oh wait, BMP is only allowed for admin, no one else has that allowance – so it’s not an issue, I forgot I did that. The reason you got “denied mime” is because it’s a bug where I didn’t add “image/bmp” to the allowed mime types for admin. I’ve reposted 0.1.9 with that fixed.

    But that’s a strange error I need to explore on the png. Apparently “Error Occurred While Processing Request” is a mysql error? Interesting.

    Did the filename have any strange characters? Quotes? Apostrophies? Unicode?


    chrishajer
    Participant

    @chrishajer

    Nothing strange in the filename, not even a space. Just a one word filename. I will test again with the new version to see if I can recreate it. It only happened that one time, and that was after the BMP image upload problem.


    _ck_
    Participant

    @_ck_

    It may have been a one-time PHP internal error dealing with uploads – in the newest 0.1.9 rebuild I put in some more advanced PHP error reporting to list the eight possible errors reported by the OS.

Viewing 24 replies - 1 through 24 (of 24 total)

You must be logged in to reply to this topic.