  | 
              
	              
	                
  
    
	 
        อัพเดท iOS แล้วโปรแกรมอัพโหลดไฟล์รูปไม่ได้  รบกวนผู้รู้ทีค่ะ     | 
   
  
    |   | 
   
 
 
 
              
  
          
		
     
		
	     
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ขอโทษด้วยค่ะที่ไม่ได้ใส่ code ยังแก้ไม่ได้เลยค่ะ อัพรูปผ่านคอมได้ปกติ แต่ผ่านไอโฟน ไอแพด(ก่อนหน้านี้อัพได้แต่หลังจากอัพเดตios ตอนนี้อัพรูปไม่ได้) ยังแจ้งเตือนสีแดงดังรูปข้างบนค่ะ 
 
 
Code (PHP) 
<td class="td2">
            <input type="file" id="pic_file" name="pic_file" size="40" accept="gif|jpg|png|hevc|heif" /><br/>
            <a href="" target="_blank">
                <img src="" id="picture" width="522" height="343"/>
            </a>
        </td>
                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2018-04-04 13:30:39 | 
                        By :
                            gullanun_s | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	     
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 รูปที่อัพโหลดมันเข้าในโฟลเดอร์อยู่ค่ะ แต่ชื่อไฟล์มันเปลี่ยนไป ตามรูป 
 
  
 
  
 
ไฟล์ save.php 
Code (PHP) 
<?
	mysql_connect("localhost","root","1234");
	mysql_select_db("assets");
	mysql_query("SET NAMES UTF8");
	$today=date("Y-m-d H:i:s");
	// ��ǹ�ͧ�������� ź ����� ������
    if($_POST['id']!=""){
			$response = "";
			$save_path = "";
	if($_FILES['pic_file']['error']!=0) {
		$response = "Error: {$_FILES['upfile']['error']}";
	}
	else {
		$accept_types = array("image/gif", "image/jpeg", "image/pjpeg",
			"image/png", "image/x-png");
		$type = $_FILES['pic_file']['type'];
		if(!in_array($type, $accept_types)) {
			$response .= "��ͧ������쪹Դ .gif, .jpeg, .jpg ���� .png ���ҹ���<br>";
		}
		else {
			$save_dir = "uploads";
			if(!file_exists($save_dir)) {
				mkdir($save_dir);
			}
			$save_path = $save_dir . "/" . $_FILES['pic_file']['name'];
			if(!move_uploaded_file($_FILES['pic_file']['tmp_name'], $save_path)) {
				$response .= "Move Failed!";
			}
		}
	}
if($_FILES['pic_file']['name']!="")
		{
	$strSQL = "update computer set comtype='".$_POST["comtype"]."',lastupdate='".$today."',code='".$_POST["code"]."',name='".$_POST["name"]."',serial_num='".$_POST["serial_num"]."',team_id='".$_POST["team_id"]."',depart_id='".$_POST["depart_id"]."',ip='".$_POST["ip"]."',brand='".$_POST["brand"]."',cpu='".$_POST["cpu"]."',mb='".$_POST["mb"]."',vga='".$_POST["vga"]."',ram='".$_POST["ram"]."',hd='".$_POST["hd"]."',lancard='".$_POST["lancard"]."',cdrom='".$_POST["cdrom"]."',monitor='".$_POST["monitor"]."',mouse='".$_POST["mouse"]."',price='".$_POST["price"]."',pdate='".$_POST["pdate"]."',detail='".$_POST["detail"]."',software='".$_POST["software"]."',pic_file='".$_FILES['pic_file']['name']."',os='".$_POST["os"]."',product_id='".$_POST["product_id"]."',vendor='".$_POST["vendor"]."',expdate='".$_POST["expdate"]."',state='".$_POST["state"]."' where id='".$_POST["id"]."'";
    $objQuery = mysql_query($strSQL);
    header("location:index.php?0");
		}else
		{
	$strSQL = "update computer set comtype='".$_POST["comtype"]."',lastupdate='".$today."',code='".$_POST["code"]."',name='".$_POST["name"]."',serial_num='".$_POST["serial_num"]."',team_id='".$_POST["team_id"]."',depart_id='".$_POST["depart_id"]."',ip='".$_POST["ip"]."',brand='".$_POST["brand"]."',cpu='".$_POST["cpu"]."',mb='".$_POST["mb"]."',vga='".$_POST["vga"]."',ram='".$_POST["ram"]."',hd='".$_POST["hd"]."',lancard='".$_POST["lancard"]."',cdrom='".$_POST["cdrom"]."',monitor='".$_POST["monitor"]."',mouse='".$_POST["mouse"]."',price='".$_POST["price"]."',pdate='".$_POST["pdate"]."',detail='".$_POST["detail"]."',software='".$_POST["software"]."',os='".$_POST["os"]."',product_id='".$_POST["product_id"]."',vendor='".$_POST["vendor"]."',expdate='".$_POST["expdate"]."',state='".$_POST["state"]."' where id='".$_POST["id"]."'";
    $objQuery = mysql_query($strSQL);
    header("location:index.php?0");
		}
		}else
		{
    $response = "";
	$save_path = "";
	if($_FILES['pic_file']['error']!=0) {
		$response = "Error: {$_FILES['upfile']['error']}";
	}
	else {
		$accept_types = array("image/gif", "image/jpeg", "image/pjpeg",
			"image/png", "image/x-png");
		$type = $_FILES['pic_file']['type'];
		if(!in_array($type, $accept_types)) {
			$response .= "��ͧ������쪹Դ .gif, .jpeg, .jpg ���� .png ���ҹ���<br>";
		}
		else {
			$save_dir = "uploads";
			if(!file_exists($save_dir)) {
				mkdir($save_dir);
			}
			$save_path = $save_dir . "/" . $_FILES['pic_file']['name'];
			if(!move_uploaded_file($_FILES['pic_file']['tmp_name'], $save_path)) {
				$response .= "Move Failed!";
			}
		}
	}
		$strSQL = "INSERT INTO computer (comtype,lastupdate,code,name,serial_num,team_id,depart_id,ip,brand,cpu,mb,vga,ram,hd,lancard,cdrom,monitor,mouse,price,pdate,detail,software,pic_file,os,product_id,vendor,expdate,state) VALUES ('".$_POST["comtype"]."','".$today."','".$_POST["code"]."','".$_POST["name"]."','".$_POST["serial_num"]."','".$_POST["team_id"]."','".$_POST["depart_id"]."','".$_POST["ip"]."','".$_POST["brand"]."','".$_POST["cpu"]."','".$_POST["mb"]."','".$_POST["vga"]."','".$_POST["ram"]."','".$_POST["hd"]."','".$_POST["lancard"]."','".$_POST["cdrom"]."','".$_POST["monitor"]."','".$_POST["mouse"]."','".$_POST["price"]."','".$_POST["pdate"]."','".$_POST["detail"]."','".$_POST["software"]."','".$_FILES['pic_file']['name']."','".$_POST["os"]."','".$_POST["product_id"]."','".$_POST["vendor"]."','".$_POST["expdate"]."','".$_POST["state"]."')";
		$objQuery = mysql_query($strSQL);
		header("location:index.php");
	}
	?>
                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2018-04-05 10:28:02 | 
                        By :
                            gullanun_s | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ถ้าไฟล์ที่อัพเป็นชื่อนั้นมันก็ได้ชื่อนั้นแหละครับยกเว้นชื่อไฟล์ที่ไม่ใช่ภาษาอังกฤษกับตัวเลขจะไม่รองรับ.                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2018-04-05 19:03:06 | 
                        By :
                            mr.v | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ไฟลเดียวกัน แต่ 
1. อัพผ่านคอม ได้เป็นรูปลักษณะแบบข้างล่าง ตามรูป 
2. อัพผ่านIpad ได้ไฟล์เป็นชื่ออะไรก็ไม่รู้ตามรูปข้างบน และเรียกดูรูปไม่ได้ 
 
ไม่รู้ว่ามันเป็นที่อะไรและต้องแก้ไขยังไง ก่อนหน้าที่จะอัพเดท ios อัพได้ปกติเลยค่ะ เป็นชื่อไฟล์เดียวกับที่อัพผ่านคอมเลย                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2018-04-09 10:19:15 | 
                        By :
                            gullanun_s | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ผมแนะนำได้แค่ว่า Rename file ก่อนทุกครับครับโดยอ้างอิงจาก date("YmdHis")                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2018-04-09 13:22:42 | 
                        By :
                            dudesaranyu | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	     
	    
     
      		  
	
     | 
   
 
                 |