I am using 'my ftp server' and 'AndFTP' for transferring files between nearby android devices. Next, configure the ftp server with username, password and port number. Then, turn on WiFi hotspot and start the ftp server(my ftp server) on device which has the file to be sent. On the receiving device,turn on the WiFi, start the ftp client(AndFTP) with the same configuration as that of ftp server and then connect to the sending device.
This method is useful for devices which do not have WiFi Direct.