You can create a file of any length using
dd if=/dev/zero of=/swap01.img bs=A count=B
Where A is the block size and B is the number of times you will write that size. The size of the image is AxB.
'mkswap' will format that file adequately.
Finally, you can add the swap using swapon, and remove it using swapoff. You can also put it in fstab just like a regular swap partition, and you can add as many swap files as you wish. Read the man pages for dd, swapon and swapoff, they might be helpful.