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!!


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -