Webmastersite.net
Register Log In

link custom attachments
lost after not completing other required fields

Comments on link custom attachments

peumus
Forum Regular

Usergroup: Customer
Joined: Aug 09, 2004
Location: Chile

Total Topics: 172
Total Comments: 462
peumus
Posted Aug 15, 2006 - 7:41 AM:

Paul,

At using custom file attachments for links:

At suggestlink.tpl I have the following code to upload images and it's working correctly submitting the images:
<input type="file" name="photo1attach">

The problem I face is when not all other required fields are filled:
At this case we are presented the suggestlink page with the phrase:
'You did not complete all of the required fields',
so we complete the pending required fields, but after submitting the link,
it do not shows the images previously selected.

I have tried using:
<input type="file" name="photo1attach" value="{LINKPHOTO1ATTACH}">
<input type="file" name="photo1attach" value="{LINKPHOTO1ATTACHNAME}">
<input type="file" name="photo1attach" value="{LINKPHOTO1ATTACHTITLE}">

But none of them seems to work remembering the image at the page asking to complete the other pending fields.

Thanks.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Aug 21, 2006 - 8:24 PM:

Does <?php echo $_FILES['photo1attach']['name']; ?> work?
peumus
Forum Regular

Usergroup: Customer
Joined: Aug 09, 2004
Location: Chile

Total Topics: 172
Total Comments: 462
peumus
Posted Aug 28, 2006 - 3:20 PM:

No, it's not working.
<?php echo $_FILES['photo1attach']['name']; ?>
is not showing anything at suggestlink.tpl after not completing all the required fields.

When suggesting a link with attachments but without another required field, the attached files seems to be uploaded as it takes time the page to refresh, but I do not find any attachment at the attachments directory looking from ftp.

Maybe a nice performance would be not to upload any attachment before all required fields are completed, but to remember the location of the attached files of the client pc. If possible.
peumus
Forum Regular

Usergroup: Customer
Joined: Aug 09, 2004
Location: Chile

Total Topics: 172
Total Comments: 462
peumus
Posted Oct 09, 2006 - 3:57 PM:

Hello Paul,
Just to know if you can have some some update on this inquiry.

Specially if you can give me an idea on how to remember the location of the attached files on the client pc, this after not completing other required files.
Or better to not upload the images if other required fields are not completed, but to remember the location of the attached images on the client pc.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Oct 10, 2006 - 1:15 AM:

$_FILES['userfile']['name'] does contains the name, but it can't be placed in the file box because value= isn't implimented by browsers:
The HTML 4.01 specification describes the value attribute for a file input field by saying that browsers (user agents) "may use the value of the value attribute as the initial file name". This however is usually not supported by browsers. The usual explanation is "security reasons".

from http://www.cs.tut.fi/~jkorpela/forms/file.html

As summarized there: "Thus, they just failed to implement it, for no good reason." Probably they're scared of all those people who click "ok" to any message and thus render warnings about the file being uploaded useless.
peumus
Forum Regular

Usergroup: Customer
Joined: Aug 09, 2004
Location: Chile

Total Topics: 172
Total Comments: 462
peumus
Posted Oct 11, 2006 - 3:33 AM:

Thanks for the information and the link.

Also when submitted a non completed all required fields form,
are the attached files uploaded and temporarily saved at the server? are these attachments automatically deleted from the server side after a time?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Oct 12, 2006 - 1:06 PM:

Non-custom files get deleted after 8 hours, but custom file field files stick around until you run the unused attachments utility.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.