Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7657669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:05:06+00:00 2026-05-31T13:05:06+00:00

I have a upload field where people can upload a image. I’d like to

  • 0

I have a upload field where people can upload a image. I’d like to add a link next to it that says: use default

So when the user doesn’t have a image to upload they can click on the link that will set a specific file (on the webserver) for that field. For example: default_picture1.jpg

I’ve read that it’s not possible (for security reasons) to use javascript to set the value of a input file type. I understand the clientside security reasons but what I’m trying to achieve is setting the value with a file on the webserver which is already there that can be used when the guest doesn’t have a picture to upload.

I tried with js but obviously doesn’t work:

<label>Picture 1</label>
<input title="" size="60" id="pic1" name="pic1" type="file" />

<a href="#" onClick="document.getElementById('pic1').value = 'test1.jpeg';">test1</a>
<a href="#" onClick="document.getElementById('pic1').value = 'test2.jpeg';">test2</a>
<a href="#" onClick="document.forms['form_upload'].elements['pic1'].value = 'test3.jpeg';">test3</a>

(btw: I was just trying 3 different ways of setting the value in JS)

Maybe it’s possible to do it with php?

If you have another idea that has to do with this, please feel free to post.

I highly appreciate your help and taking time to answer!

Regards,

Gosa

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:05:07+00:00Added an answer on May 31, 2026 at 1:05 pm

    You can not set due to the security. Imagine if you could set the file to some cookie file in user’s computer or any other personal information rich data.

    I would simply have a button to click if user wants a default image which would contain an image near the button. You can retrieve the image if user click the button. It’s your imagination.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a registration form that has a file upload field and i use
Currently I have a model 'Locations' that has an image upload field added to
I would like to have jQuery limit a file upload field to only jpg/jpeg,
Right now I have an upload field while uploads files to the server. The
I have a upload text file field, and with it I plan to save
I have a HTML file upload field from which I'm reading the file name
We have got an extjs 3.1.1 form with file upload field ( http://www.extjs.com/deploy/dev/examples/form/file-upload.html from
I'm coding a form using PHP and jQuery. I have a file upload field
Possible Duplicate: How can I upload files asynchronously with JQuery? I have a file
Does anyone have any suggestions on how I can take a DataSet that I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.