Skip to content

Upload photo

Second day I'm trying to upload file (jpeg) to the server via Ajax/PHP
Can you tell me please, what's wrong?

modify url=processupload.php
post data={"FileInput":"C:\Users\Administrator\Downloads\1442311635_a.jpg"}
just download=1

and

modify url=processupload.php
post data=FileInput=C:\Users\Administrator\Downloads\1442311635_a.jpg
just download=1

Comments

  • SvenSven www.GSA-Online.de
    edited September 2015

    how about:

    modify url=processupload.php
    post data=FileInput=%file-C:\Users\Administrator\Downloads\1442311635_a.jpg%
    just download=1

  • AdamSAdamS Australia
    edited September 2015
    doesn't work
    Array ( [name] => [type] => [tmp_name] => [error] => 4 [size] => 0 )
    from print_r($_FILES["FileInput"]);
  • SvenSven www.GSA-Online.de
    well it's not a type of file here...because how should SER know with a post data what type it should use here!?
  • AdamSAdamS Australia
    when you upload file, php knows the type, size etc
    this is when I uploaded file via firefox 
    Array
    (
    [name] => accrue2.jpg
    [type] => image/jpeg
    [tmp_name] => /tmp/phpkwRQpD
    [error] => 0
    [size] => 82047
    )
  • SvenSven www.GSA-Online.de
    edited September 2015
    yes but please understand that you have to put in the type in a webform. If thats not present, then SER has to take a default one which is type=text. So you can get the content with "post data" only in $_POST[] variable.
  • AdamSAdamS Australia
    so, there is no option to upload file to the server?
  • AdamSAdamS Australia
    in php I had someting like this, and everything is working


    $data = array(
    'file' => '@'.$iimage,
    );
    curl_post_request($ch, 'http://www.domains.com/p-upload-image.html', $data);
  • SvenSven www.GSA-Online.de
    Well why you need it as type=file?
  • AdamSAdamS Australia
    I don't need it as type=file
    but if I'll put type=text probably SER will send it as "file_path" no as a photo
    am I right? 
  • AdamSAdamS Australia
    edited September 2015
    ?? I don't know mate ;)
    I just have to send a photo, after that I can post an article
Sign In or Register to comment.