createFileAtPath, in swift -
i want download files url ( not have direct url ) , save file in local directory different name , extension.
for eg, a.jpg
but when files save, files damaged , can't open anymore.
can me, plz?
you can't rename extension. have convert it.
here way it:
uiimage *myimage = [uiimage imagewithcgimage:imageref]; nsdata *pngdata = uiimagepngrepresentation(myimage); nsdata *jpgdata = uiimagejpegrepresentation(myimage);
hope helps!!