Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Image Upload with 2.1 Version

Quote Reply
Image Upload with 2.1 Version
I have created a new column in my database to hold an image. I am able to successfully upload one from the admin area, but I do not know how to enable this so that a user can browse and upload an image. What templates need to be changed, and what is the code.

Thanks,



Gary
Quote Reply
Re: [garymill] Image Upload with 2.1 Version In reply to
You'll need to modify add.html and maybe the include_form.txt file so that they can upload a file, and also perhaps detailed.html so that you can display it. Hopefully this isn't patronising...
Quote Reply
Re: [Donald Rumsfeld] Image Upload with 2.1 Version In reply to
Thanks,

What you advised is going to be helpful.

Could you or someone else give me an idea of the code necessary to allow someone to upload the image itself.

Gary
Quote Reply
Re: [garymill] Image Upload with 2.1 Version In reply to
Don't forget to include the

enctype="multipart/form-data"

in the <form> tag.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [garymill] Image Upload with 2.1 Version In reply to
you need to change the form so it looks like this:

<form enctype="multipart/form-data" action="add.cgi" method=post>

<input type=text name=NameOfYourField type=file size=30>

rest of your form ....

</form>



it should all be okay then. hth.
Quote Reply
Re: [Donald Rumsfeld] Image Upload with 2.1 Version In reply to
Thanks for all the help!

The image upload and display process works well now.

The only glitch is now figuring out how to prevent the image info from being lost

when someone edits their link as that is what happens when someone does.

Gary
Quote Reply
Re: [garymill] Image Upload with 2.1 Version In reply to
According to this thread, others have experienced the problem of the image info being lost upon the editing of a link.

I am using version 2.10. Has this issue been addressed for this version, or is it still a problem.

Here is the thread of others that had the same problem.

http://www.gossamer-threads.com/...dify%20image;#158878
Quote Reply
Re: [garymill] Image Upload with 2.1 Version In reply to
This is what I was working on on my image upload and multiple attach when everything crashed ....

It's a complicated problem, since HTML is a stateless format.

I had two ways I was working it, and it was sort of coming together (I've been reviewing my old code trying to salvage what I could for the new plugins).

One way was to upload to a "preview" area, and use that to maintain "state" between calls.

The otherway was to use prefixes on the files, but that had some headaches of it's own.

Once I get the postcards.cgi plugin out the door, I'll probably start working on the multiple attachment issue again.

I have not been able to compile any of the image support packages -- imagemagick or netpbm on these new servers, something is in the wrong place.... so I can't really do image/upload development until then.

Maybe GT has image processing in perl that they have ready to install into the libraries...??

Image processing only needs to happen on link creation or editing, so using perl to do it, is *not* terribly horrible, although c/c++ filters still have more speed.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Image Upload with 2.1 Version In reply to
I really appreciate your answering my post. I feel better knowing that this is a known problem still that I am running into, but eventually there will be a solution.

Thanks,



Gary