|
-
Mar 27th, 2009, 05:32 AM
#1
Thread Starter
PowerPoster
Upload Field - Edit
Ok last time I checked this wasnt possible but I'll try again,
I have a form that takes some input of which 3 image upload fields exist. All works fine, when the user comes back to edit can I set the default value of the upload field to be the value they last uploaded? I understadn the security risk and why this wasnt possible but I'm interested to know if there is a work around.
Pino
-
Apr 27th, 2009, 09:52 AM
#2
Fanatic Member
Re: Upload Field - Edit
Are you using a database? If so why not create a field on the user table called "LastUploadValue" and store it there? This way you can load this value in based on the user.
-
Apr 27th, 2009, 11:12 AM
#3
Thread Starter
PowerPoster
Re: Upload Field - Edit
Psyrus,
I'm sorry but did you reply to the right thread? Having a database has nothing to do with setting the Default Value of an upload field.
-
Apr 27th, 2009, 01:47 PM
#4
Fanatic Member
Re: Upload Field - Edit
I meant using a database field to store the value as a string. When that person logs back on just load the value in from the database. I was thinking something like this:
Code:
<html>
<head>
<script>
function storepath() {dbField = sFilePath.value;}
function loadpath() {sFilePath.value = dbField;}
</script>
</head>
<body onload = "loadpath();" onloadonunload = "storepath();">
<input type="file" ID = "sFilePath">
</body>
</html>
I think the storing part will work (with modifications depending on what server side scripting you are using) but the loading part won't. This was just a thought. Sorry.
-
Apr 27th, 2009, 03:46 PM
#5
Thread Starter
PowerPoster
Re: Upload Field - Edit
Have you tested that script? Setting the value of a Upload field doesnt seem to work. (And rightly so!! It would open up a host of security issues)
Pino
-
Apr 27th, 2009, 05:22 PM
#6
Fanatic Member
Re: Upload Field - Edit
Yeah, I tried it. I posted that code as an example of what I was thinking. You can capture the value but not load it.
-
Apr 27th, 2009, 07:19 PM
#7
Re: Upload Field - Edit
 Originally Posted by Psyrus
Yeah, I tried it. I posted that code as an example of what I was thinking. You can capture the value but not load it.
Where is the database located? On the server or on the local machine? Maybe you could save the last input info to the users computer rather than the server?
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Apr 28th, 2009, 02:42 AM
#8
Thread Starter
PowerPoster
Re: Upload Field - Edit
Exactly and my question is what are the workaround for loading a value?
-
Apr 28th, 2009, 04:28 AM
#9
Re: Upload Field - Edit
 Originally Posted by Pino
Exactly and my question is what are the workaround for loading a value?
Why not save the info as a cookie instead of in a database?
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Apr 28th, 2009, 07:07 AM
#10
Thread Starter
PowerPoster
Re: Upload Field - Edit
ok seriously saving the data is not a problem... Cookie,Session,DB Not an issue.
my question is what are the workarounds for loading a value into a Upload Field, to show the user that they allready have a file uplaoded?
Last edited by Pino; Apr 28th, 2009 at 07:20 AM.
-
May 6th, 2009, 12:43 AM
#11
Re: Upload Field - Edit
 Originally Posted by Pino
ok seriously saving the data is not a problem... Cookie,Session,DB Not an issue.
my question is what are the workarounds for loading a value into a Upload Field, to show the user that they allready have a file uplaoded?
AFAIK, its not possible. When the user comes back to edit, you would hide the upload field and print some text (filename?) where the upload field was previously to show what file exists on the server. You might then include a separate upload field for uploading a new file to replace the old one.
Someone else might be able to correct me on this if I'm wrong.
-
May 6th, 2009, 04:15 AM
#12
Thread Starter
PowerPoster
Re: Upload Field - Edit
As I suspected really, Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|