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

  • Home
  • SEARCH
  • 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 7992663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:37:55+00:00 2026-06-04T13:37:55+00:00

I don’t know whats the problem. Im trying to do an image upload script.

  • 0

I don’t know whats the problem. Im trying to do an image upload script. But the choosen file is always empty(null).

Here is my form:

<form id="coffee_talk_add" action="include/scripts/add_event.php" method="post" accept-charset="utf-8" enctype="multipart/form-data">
    <table>
        <tr>
            <td class="event_width">Datum:</td>
            <td>
                <select name="day_from" id="day_from_e">
                    <option value="none" class="bold italic">Tag</option>
                        <?php
                            for($i=1; $i<=31; $i++){
                                echo "<option value=\"".$i."\">".$i."</option>\n";
                            }
                        ?>
                </select>
                <select name="month_from" id="month_from_e">
                    <option value="none" class="bold italic">Monat</option>
                        <?php
                            for($i=1; $i<=12; $i++){
                                echo "<option value=\"".$i."\">".$month_name[$i]."</option>\n";
                            }
                        ?>
                </select>
                <select name="year_from" id="year_from_e">
                    <option value="none" class="bold italic">Jahr</option>
                        <?php
                            for($i=2008; $i<=$year; $i++){
                                echo "<option value=\"".$i."\">".$i."</option>\n";
                            }
                        ?>
                </select>
            </td>
        </tr>
        <tr>
            <td>Thema:</td>
            <td class="topic"><input type="text" name="topic" id="topic_e" /></td>
        </tr>
        <tr>
            <td>Referent:</td>
            <td class="contributer"><input type="text" name="contributer" id="contributer_e" /></td>
        </tr>
        <tr>
            <td>Beginn:</td>
            <td class="begin"><input type="text" name="begin_hour" id="begin_hour_e" />:<input type="text" name="begin_min" id="begin_min_e" /> Uhr</td>
        </tr>
        <tr>
            <td>Ort:</td>
            <td class="place"><input type="text" name="place" id="place_e" /></td>
        </tr>
        <tr>
            <td>Eintritt:</td>
            <td class="entrance"><input type="text" name="entrance_euro" id="entrance_euro_e" />,<input type="text" name="entrance_cent" id="entrance_cent_e" /> €</td>
        </tr>
        <tr>
            <td>Flyer:</td>
            <td class="flyer">
                <input type="hidden" name="MAX_FILE_SIZE" value="5734400">
                <input type="file" name="image" id="image">
            </td>
        </tr>
    </table>
    <input type="hidden" name="coffee_talk_submit" value="true" />​​​​​​​​​​​​​​​​​
    <div id="add_coffee_talk">
        <input type="submit" id="small" class="coffee_talk_submit" value="speichern">
    </div>
</form>

And this is an extraction of my simple add_event.php:

if (isset($_POST['coffee_talk_submit'])) {
    $file = $_FILES['image']['tmp_name'];
    echo var_dump($file);

    if (!isset($file)) {
        //No picture choosen
        echo "No file choosen";
    } else {
        //Do stuff
        echo "upload stuff";
    }
}

And here my ajax form:

$('.coffee_talk_submit').click(function(){
    if ($('#year_from_e').val() == 'none' || $('#month_from_e').val() == 'none' || $('#day_from_e').val() == 'none' 
            || $('#topic_e').val() == '' || $('#contributer_e').val() == '' || $('#begin_hour_e').val() == '' 
            || $('#begin_min_e').val() == '' || $('#place_e').val() == '' || $('#entrance_euro_e').val() == '' || $('#entrance_cent_e').val() == '') {
        $("#dialog_empty").dialog( "open" );
        return false;
    }

    var form = $('#coffee_talk_add');  
    var data = form.serialize(); 

    $.ajax({
        url: "include/scripts/add_event.php",
        type: "POST",
        data: data,
        dataType: 'json',
        success: function (reqCode) {
            if (reqCode['error_code'] == 1) {
                //Termin erfolgreich eingetragen
                $("#dialog_ok").dialog( "open" );
            } else if (reqCode['error_code'] == 2) {
                //Eintrag bereits vorhanden
                $("#dialog_error").dialog( "open" );
            }
            clear_form_elements(form);
        }
    });
    return false;
});

I looked up into info.php and found out that file_upload is allowed but temp_folder has no value. Is this the reason why my script can’t find the tmp_name file? I can’t change any values cause my hoster do not allow to make any changes in php.ini (can’t even get access to file). If so is there any other way to handle this?

  • 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-06-04T13:37:56+00:00Added an answer on June 4, 2026 at 1:37 pm

    digital upload of binary data needs to be done via hidden iframe.
    ajax fails with binary data.
    you can use ajax to poll status

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

Sidebar

Related Questions

I don't know whether this is really possible, but I'm trying my best. If
Don't know how to explain it better but i'm trying to get a response
Don't know whats exactly going on, but it's definitely killing my time for nothing.
Don't know if this is an eclipse specific problem but whenever I declare a
Don't know a better title but here is what im trying to do. I
Don't really know how to formulate the title, but it should be pretty obvious
Don't know how to google for such, but is there a way to query
Don't know why but font is not displaying.Please help. CSS(in css folder): style.css: @font-face
Don't know if I worded the question right, but basically what I want to
(Don't know if this is strictly on-topic, but I don't see any better Stack

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.