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 436649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:29:57+00:00 2026-05-12T20:29:57+00:00

I am trying to upload an image to the server. I hava a form

  • 0

I am trying to upload an image to the server.

I hava a form with a couple of inputs…
INSIDE this form, I have an Iframe which contains another form for the upload, this because I dont want the original form to submit().

The original form basically:

      <form> ...... bla bla bla alot of inputs....<iframe src="pic_upload.html"></iframe></form>

Here is pic_upload.html:

      </head>
      <body><form name="pic_form" id="pic_form" action="bincgi/imageUpload.php" method="post" target="pic_target"><input name="pic_file" type="file" id="pic_file" size="35" onchange="this.form.submit();"></form><div id="pic_target" name="pic_target" style="width:80px; height:80px;"></div></body>
      </html>

Here is imageUpload.php:

      <?php
      $destination_path = getcwd().DIRECTORY_SEPARATOR;
      //echo $destination_path;
      $result = 0;
      $target_path = $destination_path . basename($_FILES['pic_file']['name']);
      if(@move_uploaded_file($_FILES['pic_file']['tmp_name'], $target_path)) {
      $result = 1;
      }
      ?>

I get this error: Undefined index: pic_file on line 5 in imageUpload.php

ALSO, if I get this to work, is there a good way to display the uploaded image inside the target of the form?

Thanks alot!
PS: I will add javascript to the tags because maybe thats what I need here!

  • 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-12T20:29:57+00:00Added an answer on May 12, 2026 at 8:29 pm

    Don’t forget about form attribute

    enctype="multipart/form-data"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to upload an image from inside a JQuery modal. The form
I am trying to upload image file from my one server to another remote
I'm trying to upload an image to my site through a form, however it's
I am trying to upload a image which i am clicking with the help
I am trying to set a default image for my image upload form. In
I'm trying to create a dialog which will allow users to upload an image.
I am trying to upload an image to server using iphone . I haven't
I am trying to Upload image Capture by Camera into server. server send response
I have a requirement to upload image on server in 2 size, normal and
I'm trying to upload an image from android to a PHP server by using

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.