php - Saving image on db mysql through swift
Get the solution ↓↓↓i have a problem with my php file. I'm trying to upload an image through xcode to mysql db.
here's swift code
let image = UIImage(named: "image.jpg")
var imageData = UIImageJPEGRepresentation(image, 1)
if imageData != nil{
var request = NSMutableURLRequest(URL: NSURL(string:"link php file")!)
var session = NSURLSession.sharedSession()
request.HTTPMethod = "POST"
var boundary = NSString(format: "
and here's php code:
{-code-2}
the problem is in the path. it returns wrong path and so i found no image in "uploads" folder. if i change target_path in php file (for example $target_path = "uploads/image.jpg"), image is saved.
i think it's a very easy problem but i don't understand what i have to change.
thanks for any help
hi
Answer
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: using $this when not in object context laravel
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.