Gossamer Forum
Home : Products : Links 2.0 : Customization :

About the upload mod by phoenix.

(Page 1 of 2)
> >
Quote Reply
About the upload mod by phoenix.
I posted this already as a reply but my message didn't show up though I tried refreshing. Weird...

Phoenix, your - or is it by Alex? - upload mod is really great but could it be done in the admin area? So that administrators would be able to upload files?

I don't even have a add.cgi because I don't need user submissions.
Quote Reply
Re: About the upload mod by phoenix. In reply to
Ok.

I have proceeded a bit since the first post:
* New field succesfully added
* Automatic new form input type (...type=file...) successfully added into db_utils.pl

The only thing I want to know now is where to put the sub "get_file_and_form" and wherefrom to call it?

phoenix? Anyone?
Quote Reply
Re: About the upload mod by phoenix. In reply to
Where can I get the upload mod?

I jumped the gun, nevermind, I see it.

------------------
James L. Murray
VirtueTech, Inc.
www.virtuetech.com


[This message has been edited by Ground Zero (edited August 06, 1999).]
Quote Reply
Re: About the upload mod by phoenix. In reply to
Ground Zero or Stigma , where did you see it? Please list the thread here Smile
Thanks
TimRyan
Quote Reply
Re: About the upload mod by phoenix. In reply to
Use your eyes or search option man! =)

Check it out:
http://www.gossamer-threads.com/...um3/HTML/002036.html
Quote Reply
Re: About the upload mod by phoenix. In reply to
Now I've inserted the upload subs (found in the new add.cgi) into db.pl and created a new sub (similar to "main" sub) which is called when adding resources.

I also changed the add resource form's posting method from POST to GET. Before that form didn't work at all.

Now every field information goes through except the image! That's not a minor problem as you can guess. =)

I'll continue solving the problem...
Quote Reply
Re: About the upload mod by phoenix. In reply to
I too have had similar problems. All of the fields work except for the image which will not upload. Have you solved your problem.
Thanks.
-Greg
Quote Reply
Re: About the upload mod by phoenix. In reply to
One more question. How do you change this line:

<form action="<%db_cgi_url%>/add.cgi" enctype='multipart/form-data' method="POST">

into non template format. I had tested earlier but this may be the source of my problem. Thanks.
-Greg
Quote Reply
Re: About the upload mod by phoenix. In reply to
I'm glad to know I'm not the only one interested in this mod! =)

I made this change in sub html_add_form in admin_html.pl:

###########################################

if ($in{'db'} eq "link") {
print qq|<form action="$db_script_url" method="GET" enctype="multipart/form-data">|;}
else {
print qq|<form action="$db_script_url" method="POST">|;}

###########################################

I used the if-else because we don't need the multipart-crap when we add categories.

And no, I haven't figured this out.
Quote Reply
Re: About the upload mod by phoenix. In reply to
I've experienced problems getting the image to upload too. Everything else works though. It's something with the
Code:
name="attach"
I think. Just guessing.

It's not ever referenced in the modified add.cgi. However calls to the "FILE_CONTENT" and "FILE_NAME" are made.

You would think that would do it.

I've played around with this a lot and I'm stuck. Has anyone got the mod to work right out of the box. (before implementing it into the admin) If there's something that needs to be addressed in the instructions I'd really appreciate the info.

It's a little unclear as to whether or not the upload field is named "attach" or anything else. The way add.cgi just references "FILE_CONTENT" it would seem that any name would work. Should it be "Image" like the new field name?

I'm lost.
Quote Reply
Re: About the upload mod by phoenix. In reply to
No jeffo. It doesn't depend on the name=attach.

I tested the mod and it works just fine as it is. And those "FILE_CONTENT" etc. are inside the image files and recognized by server I think.

As I see it, the biggest problem is to make the script parse the "get_file_and_form" sub without parsing the non-file form fields.
Quote Reply
Re: About the upload mod by phoenix. In reply to
Stigma, have you actually gotten the image to upload from the user to your server? So far the image has not been uploaded, but the rest of the information does. Thanks.
-Greg
Quote Reply
Re: About the upload mod by phoenix. In reply to
Strange.

I just replaced my add.html template with a fresh copy and it works now. I must have had a typo in there somewhere.

The images upload to the Attach directory and are given the ID number as a suffix. However, when I try to load them into an html page, the link to the image is broken. And when you download to disk the suffix is taken off.

What's the deal with the suffix getting taken off and not allowing display?

Anyone having similar problems?
Quote Reply
Re: About the upload mod by phoenix. In reply to
"Have you actually gotten the image to upload from the user to your server?"

Yes. That's what the Alex's mod does as it is without any modifications. But I haven't got the image uploaded when using the admin area.

"So far the image has not been uploaded, but the rest of the information does"

Yep, that's my problem now. But I didn't have any problems uploading images with the modified add.cgi which is included in the mod.
Quote Reply
Re: About the upload mod by phoenix. In reply to
Even when I fill out the Image field I always get this error when I hit the submit button in add.cgi:

You must either attach a file or enter data in the Image field.

This causes the image not to upload. I DO fill out the field though and they say that it is not filled in. Any suggestions? I think that it is because of this line:

Code:
<form action="<%db_cgi_url%>/add.cgi" enctype='multipart/form-data' method="POST">

Because I don't use templates I turned this line into:

Code:
<form action="$build_add_url" enctype='multipart/form-data' method="POST">

Was I right in changing this code? Or should I change this into something else? Any reasons why this field would be empty even though I filed it out? By the way I made the field required in links.cfg like phoenix said and not in links.def.
Thanks for your help,
-Greg
Quote Reply
Re: About the upload mod by phoenix. In reply to
Does anyone know why the field would be empty like this?
Quote Reply
Re: About the upload mod by phoenix. In reply to
How does one upload more that 1 picture at a time?
Quote Reply
Re: About the upload mod by phoenix. In reply to
hi,
when i add a link, everything seems fine, but the images are uploaded in a wierd way :
these are two images i uploaded:

http://209.102.88.17/bookshop/Attach/

can someone please help ?
Thank you
Quote Reply
Re: About the upload mod by phoenix. In reply to
what page are you uploading from? it looks like u didn't do the form right. give me a url

--tom
Quote Reply
Re: About the upload mod by phoenix. In reply to
o sorry, i uploaded the original files back , becasue i needed to add some stuf to the database and i didnt eant anything to go worng.

i will upload the moded files again , and send you the URL. right now, my FTP server is out, so i cant upload, my partner ( the server admin. ) is enjoying his weekend ;-)

here is the form i used : ( the field i use for the image is 'Graphic' )

<form action="<%db_cgi_url%>/add.pl" enctype='multipart/form-data' method="POST" name="">
<table border ="0" cellspacing="0" cellpadding="3" width="100%">
<tr>
<td align="right" colspan="2">
<hr size="1">
</td>
</tr>
<tr>
<td valign="top" width="24%">
<div align="center"><font size="2" color="#FF9900"><b>Add a Book</b></font></div>
</td>
<td valign="top" width="76%"><font size="2">Please fill out the form
completely, <br>
and we'll add your resource as it is approved.</font></td>
</tr>
<tr>
<td align="right" valign="top" width="24%"><font size="2" color="#006600">Title:</font></td>
<td width="76%">
<input name="Title" size="30">
</td>
</tr>
<tr>
<td align="right" valign="top" width="24%"><font size="2" color="#006600">URL:</font></td>
<td width="76%">
<input name="URL" size="30">
</td>
</tr>
<tr>
<td align="right" valign="top" width="24%"><font size="2" color="#006600">Category:</font></td>
<td width="76%"><%Category%></td>
</tr>
<tr>
<td align=right valign=top width=20% height="2"><font face="verdana,arial,helvetica" size="2" color="#006600">Author:</font></td>
<td width=80% height="2">
<input type=text name="Author" size="10" maxlength="40">
</td>
</tr>
<tr>
<td align=right valign=top width=20%><font face="verdana,arial,helvetica" size="2" color="#006600">Publishing
date:</font></td>
<td width=80%>
<input type=text name="Publishdate" value="" size="10" maxlength="40">
</td>
</tr>
<tr>
<td align=right valign=top width=20%><font face="verdana,arial,helvetica" size="2" color="#006600">#
of Pages:</font></td>
<td width=80%>
<input type=text name="Pages" value="" size="10" maxlength="8">
</td>
</tr>
<tr>
<td align=right valign=top width=20%><font face="verdana,arial,helvetica" size="2" color="#006600">List
price:</font></td>
<td width=80%>
<input type=text name="Listprice" value="" size="5" maxlength="10">
</td>
</tr>
<tr>
<td align=right valign=top width=20%><font face="verdana,arial,helvetica" size="2" color="#006600">Your
price:</font></td>
<td width=80%>
<input type=text name="Ourprice" value="" size="5" maxlength="10">
</td>
</tr>
<tr>
<td align="right" valign="top" width="24%"><font size="2" color="#006600">Brief
Description:</font></td>
<td width="76%">
<input type="text" name="Description" size="33" maxlength="150">
</td>
</tr>
<tr>
<td align="right" valign="top" width="24%"><font size="2" color="#006600">Full
Review:</font></td>
<td width="76%">
<textarea name="Full" rows="6" cols="33"></textarea>
</td>
</tr>
<tr>
<td align="right" width="24%" valign="top"><font size="2" color="#006600">This
review by :</font></td>
<td width="76%">
<input type="text" name="Whoreview" size="30">
</td>
</tr>
<tr>
<td align="right" valign="top" width="24%"><font size="2" color="#006600">Contact
Name:</font></td>
<td width="76%">
<input name="Contact Name" value="" size="30">
</td>
</tr>
<tr>
<td align="right" valign="top" width="24%"><font size="2" color="#006600">Contact
E-mail:</font></td>
<td width="76%">
<input name="Contact Email" value="" size="30">
</td>
</tr>
<tr>
<td align=right valign=top width=20%><font face="verdana,arial,helvetica" size="2" color="#006600">Image:</font></td>
<td width=80%>
<input type="file" name="Graphic">
<input type=hidden name="Graphic" size="40" maxlength="75" value="">
</td>
</tr>
<tr>
<td align="right" valign="top" width="24%"><font size="2" color="#006600">Password:</font></td>
<td width="76%">
<input name="Password" size="30">
</td>
</tr>
<tr>
<td width="24%" height="2"> </td>
<td width="76%" height="2">
<input type="SUBMIT" value="Add Resource" name="SUBMIT">
</td>
</tr>
</table>
</form>
Quote Reply
Re: About the upload mod by phoenix. In reply to
Has anyone been able to implement this for the Admin ?

Thank you
Quote Reply
Re: About the upload mod by phoenix. In reply to
Its not working for me. It refuses to recognize the in-attachment file. any ideas?

------------------
Quote Reply
Re: About the upload mod by phoenix. In reply to
Hi all,

I have installed the upload mod, but am experiencing a major problem.

Basically, my database links directly to files (rather than URL). Currently all of these files are located in another server. However, I want to add the ability for users to upload their own files to my server and added to my database.

Phoenix's mod is the perfect solution. I have set it up so that the uploaded link goes into "URL", an existing field.

There's no problem with uploading the file to the server, which retains its file name. However, its contents are entirely replaced by the the "Contact Email" field contents.

I followed the instructions to the last word. I even played out scenarios of using the EXACT example of creating a new field "Image" to store the uploaded file. However, the same problem keeps recurring.

I wonder if any of you have encountered such a strange problem. What am I doing wrong??? Hopefully one of you have an answer as I see that you all have been quite successful in implementing the same mod for your websites.

sincerely,

Malt
Quote Reply
Re: About the upload mod by phoenix. In reply to
Yes. I got the same problem. All the image name are ok and they are in the server. But the content give me "Submit" only. I mean a JGP format file which contains the words "Submit". I really can't figure out what's going on? Am I wrong? I really don't think so because I did follow the instructions.

Can any help or have any experiences with it? Or anyone have a working form so that I can have a look of how the field name orginized?

Million Thanks.

------------------
Bear EveryWhere
Quote Reply
Re: About the upload mod by phoenix. In reply to
I just think if this mod have some problem, it shouldn't be posted anymore.

I would rather use a upload script in cgi-resources.com and allow user to upload their image to a temp directory after they registered. It can really save a lot of my time.

------------------
Bear EveryWhere
> >