iOS Question postmultipart and chmod

Discussion in 'iOS Questions' started by tufanv, May 28, 2018.

  1. tufanv

    tufanv Expert Licensed User

    Hello ,

    I use the below code to upload files:

    Code:
    Dim MFD As MultipartFileData
        MFD.Initialize
        MFD.Dir = 
    File.DirDocuments
        MFD.FileName = sen
        MFD.KeyName = 
    "userfile"
        H.PostMultipart(
    "",Null,Array(MFD))
        H.PostMultipart(
    "server",CreateMap("username":"b4x","password":"supersafe"),Array(MFD))
    and php side is:

    Code:
    $uploaddir = '/home/www/uploads';
    $uploadfile = $uploaddir . basename($_FILES['userfile']['name']);

    echo 
    '<pre>';
    if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
        echo "File is valid, and was successfully uploaded.\n";
    } else {
        echo "Possible file upload attack!\n";
    }
    if I dont set the upload dir chmod to 777 file is not being uploaded. Even 755 chmod is not enough. Chmod 777 may be a security risk for me so , what should I do with this ? Is there a reason I cant upload without chmod 777 ?

    TY
     
  2. Erel

    Erel Administrator Staff Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice