2 of 4
2
Just bought Module and need help
Posted: 27 August 2007 10:12 PM   [ Ignore ]   [ # 16 ]
Newbie
Rank
Total Posts:  14
Joined  2007-08-27

Okay here’s the field on my SAEF along with the code that brings up the pop-up file upload window.

Photo
<input type="text" name="photo_classified" /></td>

a href="{path=''}index.php/classifieds/file_upload_template" onclick="window.open(this.href, '_blank', 'width=400,height=600');return false;" onkeypress="this.onclick()">File Upload</a

And here’s the relevant bits of the file upload template.

{exp:file_upload:upload_form form_name="entryform" destination="Z Classified Ad Images" field_name="photo_classified" rename_duplicates="yes" return="classifieds/file_upload_placement"}
    
<input type='file' name='userfile' />
    <
input type='submit' class='submit' value='Upload' />
{/exp:file_upload:upload_form}

And here’s the file_upload_placement template (with {javascript} in the HEAD.

{exp:file_upload:upload_confirm field_replace="replace"}
    
<input type='submit' class='submit' value='Close Window' onclick='fileplacer();window.close();' />
{/exp:file_upload:upload_confirm}

Everything is working fine until the very end. When I “Close Window\” the window does not close, the file URL is not placed in the field in the SAEF and my home page loads in the pop-up window.

Thanks for any help!
c-

Profile
 
 
Posted: 27 August 2007 10:36 PM   [ Ignore ]   [ # 17 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  701
Joined  2004-03-30

Hey I know you! What’s up sucka?

I was just looking at this bug on another site today. It’s due to the fact that you’re accessing the page containing your main entry form from http://blah.com instead of http://www.blah.com. Javascript has some security that kicks in when there is variation in the domain name and www triggers it.

Try forcing the WWW on all incoming requests through your htaccess file.

Holler!

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 27 August 2007 10:40 PM   [ Ignore ]   [ # 18 ]
Sr. Member
Avatar
RankRankRankRank
Total Posts:  336
Joined  2005-07-09

Wow, that’ve never occurred to me… Makes total sense, though. Does that work for you, Chris?

 Signature 

Ingmar Greil

Profile
 
 
Posted: 27 August 2007 10:56 PM   [ Ignore ]   [ # 19 ]
Newbie
Rank
Total Posts:  14
Joined  2007-08-27

Heya Mitchell!

I do force WWW through HTACCESS.....

RewriteCond %{HTTP_HOST} !^www.flatheadbeacon.com$ [NC]
RewriteRule
^(.*)$ http://www.flatheadbeacon.com/$1 [L,R=301]

Any other ideas?

I’ll holler at you tomorrow.
c-

Profile
 
 
Posted: 27 August 2007 11:00 PM   [ Ignore ]   [ # 20 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  701
Joined  2004-03-30

Chris,

Can you at least confirm that the www thing is the problem in your case?

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 27 August 2007 11:12 PM   [ Ignore ]   [ # 21 ]
Newbie
Rank
Total Posts:  14
Joined  2007-08-27

Sorry, Mitchell, I don’t follow. It would appear that the WWW is not the problem for me given my URL rewrites.

Then again, I’m starting to go cross-eyed........

c-

Profile
 
 
Posted: 28 August 2007 09:19 AM   [ Ignore ]   [ # 22 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  701
Joined  2004-03-30

Chris,

Use Firefox and open the Error message panel so that you can track Javascript errors. Should give you some more info to work with.

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 28 August 2007 09:33 AM   [ Ignore ]   [ # 23 ]
Newbie
Rank
Total Posts:  14
Joined  2007-08-27

Okay, when I click “Close and Place Image” from my file_upload_placement template I get

“opener.document.entryform has no properties”

c-

Profile
 
 
Posted: 28 August 2007 10:28 AM   [ Ignore ]   [ # 24 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  701
Joined  2004-03-30

Chris,

What’s the name of your entry form? and what’s the id?

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 28 August 2007 10:35 AM   [ Ignore ]   [ # 25 ]
Newbie
Rank
Total Posts:  14
Joined  2007-08-27

Here’s my entry form.

{exp:weblog:entry_form weblog="classifieds" return="{entry_id_path='classifieds/my_ad'}"}
                
<table width="100%" cellspacing="0" cellpadding="0" border="0" id="classifieds">
                    <
input type="hidden" name="entry_id_return" value="classifieds/my_ad/%&#xen;try_id%%" />
                    <
input type="hidden" name="expiration_date" value="{exp:classifieds:renew increment="60"}" />
                    <
input type="hidden" name="allow_comments" value="y" />
                    <
tr class="row-one">
                        <
td class="cl_label">Title of Your Ad</td>
                        <
td><input type="text" name="title" /></td>
                    </
tr>

                    <
tr class="row-two">
                        <
td class="cl_label">Price</td>
                        <
td><input type="text" name="{exp:form_helper:field_grabber field_name='classifieds_price'}" /></td>
                    </
tr>
                    <
input type="hidden" name="{exp:form_helper:field_grabber field_name='classifieds_price' which='format'}" value="none" />

                    <
tr class="row-one">
                        <
td class="cl_label">Short Description</td>
                        <
td><textarea cols="35" name="{exp:form_helper:field_grabber field_name='classifieds_short'}"></textarea></td>
                    </
tr>
                    <
input type="hidden" name="{exp:form_helper:field_grabber field_name='classifieds_short' which='format'}" value="br" />

                    <
tr class="row-two">
                        <
td class="cl_label">Full Description</td>
                        <
td><textarea rows="6" cols="35" name="{exp:form_helper:field_grabber field_name='classifieds_full'}"></textarea></td>
                    </
tr>
                    <
input type="hidden" name="{exp:form_helper:field_grabber field_name='classifieds_full' which='format'}" value="br" />


                    <
tr class="row-one">
                        <
td class="cl_label">Photo</td>
                        <
td><input type="text" name="photo_classified" /></td>
                    </
tr>
                    

                     <
tr class="row-two">
                        <
td></td>
                        <
td><input type="submit" name="submit" value="post my ad" class="submit" /></td>
                    </
tr>
                </
table>

                
{/exp:weblog:entry_form}

Profile
 
 
Posted: 30 August 2007 04:48 PM   [ Ignore ]   [ # 26 ]
Newbie
Rank
Total Posts:  14
Joined  2007-08-27

Hi Ingmar and Mitchell,

Another couple hours and I’m still scratching my head on this one.

Mitchell, you asked about the id and name of my form. I’m using the EE SAEF and I understand that the default id is “entryform”

I was looking at the page source for the FILE_UPLOAD_TEMPLATE and noticed that the ACTION on the form is “http://www.flatheadbeacon.com”. That doesn’t seem right to me. Here’s that form when viewed as source:

<form method="POST" enctype="multipart/form-data" action="http://www.flatheadbeacon.com/" >
<
input type="hidden" name="ACT" value="34" />
<
input type="hidden" name="destination" value="3" />
<
input type="hidden" name="form_name" value="entryform" />
<
input type="hidden" name="field" value="field_id_42" />
<
input type="hidden" name="entry_id" value="" />
<
input type="hidden" name="return" value="classifieds/file_upload_placement" />
<
input type="hidden" name="field_replace" value="" />
<
input type="hidden" name="rename_duplicates" value="yes" />

   <
input type='file' name='userfile' />
   <
input type='submit' class='submit' value='Upload' />
  </
form>

Am I missing something obvious here?

Thanks again,

-chris

Profile
 
 
Posted: 30 August 2007 04:50 PM   [ Ignore ]   [ # 27 ]
Newbie
Rank
Total Posts:  14
Joined  2007-08-27

And here’s what the FILE_PLACEMENT_TEMPLATE form looks like:

<form name='upload' method="post" action="http://www.flatheadbeacon.com/"  >
<
div>
<
input type="hidden" name="XID" value="e15ff3d94593d3bbe7ba1d790e82f6a5c4bb9dc9" />
<
input type="hidden" name="nonimage" value="no" />
<
input type="hidden" name="style" value="inline" />

Profile
 
 
Posted: 31 August 2007 04:05 PM   [ Ignore ]   [ # 28 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  701
Joined  2004-03-30

Chris,

Better email me the Flathead EE CP login info. My old id is not working anymore.

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 28 October 2007 06:50 AM   [ Ignore ]   [ # 29 ]
Member
Avatar
RankRankRank
Total Posts:  71
Joined  2006-05-10

Hi Mitchell,

Sorry for butting in on the end of this post like this but I am also having the same problems. I have copied the standard SAEF code from the EE user documentation changing the {upload_url} to {path="photo-upload"}

Within this photo-upload template I then have this code below :

{exp:file_upload:upload_form form_name="entryform" enctype="multipart/form-data" destination="Main Upload Directory" field_name="photos-download" return="file-upload-placement"}
<p><input type='file' name='userfile' /></p>
<
input type='submit' value='Upload' />
{/exp:file_upload:upload_form}

I have placed in the “Main Upload Directory” as the place where I want the file to be uploaded to and field_name="photos-download” as the field where I want the value to be stored in my SAEF and the return="file-upload-placement” then has this code in it :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<
title></title>

<
style type="text/css">
<!--

-->
</
style>
{javascript}
</head>
<
body>

{exp:file_upload:upload_confirm field_replace="replace"}
<input type='submit' value='Place Image and Close Window' onclick='fileplacer();window.close();' />
{/exp:file_upload:upload_confirm}

</body>
</
html>

When I click on the File Upload link in the SAEF then the photo-upload template does indeed pop-up as it is supposed to. I choose a file and click upload and it does get uploaded as I can check with FTP in that folder. If I then click on the Place Image and Close Window link all that happens is that this smaller window refreshes back to my main homepage URL and nothing gets placed into the field in the SAEF although as mentioned before the file is uploaded correctly.

Any help with this would be massively appreciated.

Best wishes,

Mark

Profile
 
 
Posted: 05 March 2008 10:39 PM   [ Ignore ]   [ # 30 ]
Member
RankRankRank
Total Posts:  100
Joined  2007-03-12

The documentation is very badly written I’m afraid. I’m trying to understand how many templates we actually need. Oh and I paid $35 without realising it is donationware but as you guys make such good software, I don’t mind smile

Now how about some model code on how we should be doing this?

Profile
 
 
   
2 of 4
2