1 of 2
1
no_file_selected error
Posted: 21 September 2008 01:17 PM   [ Ignore ]
Jr. Member
RankRank
Total Posts:  36
Joined  2006-11-03

Hi,

I’m trying to use the file upload module with the saef and I’m getting the error “no_file_selected” Above that I’m getting this php error:

Notice: Undefined index: userfile in /www/eh8537/public_html/glcsys/core/core.upload.php on line 95

Here’s my file upload template:

{exp:file_upload:upload_form form_name="entryform" destination="images" field_name="profile-photo" return="profile/photo"}

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

{/exp:file_upload:upload_form}

and my file placement template:

{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}

Does the {javascript} go in the head of the file placement template?  Does it need to go within the {exp:file_upload} tag?

I’m using this with the SAEF that is also using the form helper plugin.

I’m logged in as superadmin and my images diretory is set to 777.

Any ideas?

Thanks

Profile
 
 
Posted: 21 September 2008 10:00 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

fodney,

Yes, the {javascript} variable needs to go into the Placement template smile

I would also make sure that the destination field you specified is the Full Name of the file upload preference created… like this.

{exp:file_upload:upload_form form_name="entryform" destination="Main Upload Directory" field_name="body" return="file_upload/placement"

<p><input type="file" name="userfile" /></p
<
p><input type="submit" value="Upload" /></p

{/exp:file_upload:upload_form}

Where are you seeing these errors (which template)? smile
Also, are they showing up when the page loads, or after submit, etc?

 Signature 
Profile
 
 
Posted: 22 September 2008 06:16 AM   [ Ignore ]   [ # 2 ]
Jr. Member
RankRank
Total Posts:  36
Joined  2006-11-03

Hi Pie Man,

Thanks.  Yes, I’m using the descriptive name of the destination directory. 

I see the errors on the upload template. I click on “choose file” and I browse for a file.  I then see the icon for the file on the page.  Then when I click upload I get the errors.

Does the {javascript} variable need to be between file_upload tags or just in the head?  I’ve tried both.

Profile
 
 
Posted: 22 September 2008 11:36 AM   [ Ignore ]   [ # 3 ]
Jr. Member
RankRank
Total Posts:  36
Joined  2006-11-03

Hi Pie Man,

Sorry to bump but the client is after me on this one.

thanks

Profile
 
 
Posted: 22 September 2008 12:29 PM   [ Ignore ]   [ # 4 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

Fodney,

Maybe let me hop in your CP and I will tinker with it… it’s probably just some confusion as to how and where to place the code smile
I struggled with File Upload my first time too, haha wink

 Signature 
Profile
 
 
Posted: 22 September 2008 12:34 PM   [ Ignore ]   [ # 5 ]
Jr. Member
RankRank
Total Posts:  36
Joined  2006-11-03

Thanks.  I just pm’d you the login info.

Profile
 
 
Posted: 22 September 2008 12:46 PM   [ Ignore ]   [ # 6 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

Fodney,

The issue is you have the File Upload field directly into the SAEF form. You actually need to reference it externally (as a seperate template and window - popup).

Have a look here at the examples smile

http://www.solspace.com/docs/entry/file_upload_21_upload_form/#examples

Sample code to create popup for File Upload form - this would go into your SAEF Form:

a href="{path=popups/file_upload}" onclick="window.open(this.href, '_blank', 'width=300,height=100');return false;" onkeypress="this.onclick()">Click here to Upload File</a>

 Signature 
Profile
 
 
Posted: 22 September 2008 01:14 PM   [ Ignore ]   [ # 7 ]
Jr. Member
RankRank
Total Posts:  36
Joined  2006-11-03

Ok, I understand the concept now.  I’ve got the link in to the upload template.  When the upload template comes up I choose the image, upload it and then when the placement window comes up I hit place image and close window but the window doesn’t close--it goes to my homepage.  The image isn’t getting placed in the custom field either.

http://glc.pmhclients.com/profile/bio/

any idea where I’m messing up now?

Profile
 
 
Posted: 23 September 2008 09:48 AM   [ Ignore ]   [ # 8 ]
Jr. Member
RankRank
Total Posts:  36
Joined  2006-11-03

Pie Man,

Could you take a look for me?

THanks

Profile
 
 
Posted: 23 September 2008 12:31 PM   [ Ignore ]   [ # 9 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

Fodney,

The issue was that you did not have the “profile-photo” field specified in your “bio” template. It needs to be there so File Upload can paste it in there.
I’ve went ahead and created the field for you, and set it as hidden. smile

 Signature 
Profile
 
 
Posted: 23 September 2008 01:15 PM   [ Ignore ]   [ # 10 ]
Jr. Member
RankRank
Total Posts:  36
Joined  2006-11-03

Thanks Pie Man for your help.  It seems to work in most cases but occasionally after I upload the image I won’t get the placement template I’ll get my site homepage and only a fragment of the img tag will get uploaded like “<img sr”

I’ve got a conditional statement in my bio template to show the uploaded file if it already exists with the option to overwrite it.  Not sure if this is affecting it.

Thanks

Profile
 
 
Posted: 23 September 2008 03:05 PM   [ Ignore ]   [ # 11 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

I see…

I guess this will always be an issue as we need to have it as a hidden field, and any new uploads will just add themselves to the existing data, which can cause all this hooplah.
The only way we could avoid this is if we left the field blank, but then if the person already had a photo, it’d be overwritten with nothing. If we keep it, it just keeps adding multiple links.

The issue is we have the Photo and the Bio on the same page, so perhaps the best way to go about it would be to have the Photo Upload feature as a separate page, where the field is left blank, and touched only if someone goes to that page, and the only reason you’d want them on that page is if they plan to upload a new photo…

Does that make sense? smile

 Signature 
Profile
 
 
Posted: 23 September 2008 03:07 PM   [ Ignore ]   [ # 12 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

The only other thing I could suggest that would work around this issue, is the Gallery Extended module, which you can relate photos to Weblog Entries… but it still would have to be a seperate form/template because it’s it’s own form....

 Signature 
Profile
 
 
Posted: 23 September 2008 03:20 PM   [ Ignore ]   [ # 13 ]
Jr. Member
RankRank
Total Posts:  36
Joined  2006-11-03

I dunno.  I put the photo upload function on it’s own page but the same thing is happening.  After I upload the first photo and then I try to upload another to overwrite it the placement template doesn’t come up but the homepage does and just the “<img src=” fragment gets uploaded.

http://glc.pmhclients.com/profile/photo/

Profile
 
 
Posted: 23 September 2008 03:55 PM   [ Ignore ]   [ # 14 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

You’ll have to remove this part of the hidden field:

value="{profile-photo}"

That will allow it to have a “fresh start” smile

 Signature 
Profile
 
 
Posted: 24 September 2008 06:21 AM   [ Ignore ]   [ # 15 ]
Jr. Member
RankRank
Total Posts:  36
Joined  2006-11-03

I just removed value="{profile-photo}" and also tryed changing it to value="” but I’m still having the same problem.  It seems to work the first time by replacing the image but then when I try it again it borks.  Same problem of the homepage coming up in the placement template and the new image doesn’t replace the old. 

I think these students are going to likely try to upload and replace several photos so I need to trust it will work repeatedly.

Thanks for your help Pie Man.

Profile
 
 
   
1 of 2
1