 						
 					new decompress( mode: '755' )
 					 .src file.path
-					 .dest dirName
+					 .dest DRIVERS_DIR
 					 .use plug strip: 1
 					 .run (err) ->
 						if err
 							callback 'Error unzipping the driver', null
-							return
-				
-						# Initialize the driver:
-						unless driverModule = require dirName + file.name
-							callback 'Couldn\'t find module', null
-						unless isActuator = driverModule.isActuator or isSensor = driverModule.isSensor # or (!isActuator and !isSensor)
-							callback 'Driver not defining if for Sensors and/or Actuators', null
-							
-						unless driverModule.add and driverModule.remove and driver.update and driver.apply and (!isActuator or driver.init)
-							callback 'Driver not implementing the interface', null
-							
-						driverModule.init (err) ->
-							if err
-								callback 'Error initializing the driver', null
-							else
-								# If everything worked, save the Driver instance in DB:
-								data =
-									name: file.name
-									isSensor: isSensor
-									isActuator: isActuator
-								superCreate data, (err, driver) ->
-									if err
-										callback 'Error saving the driver in DB', null
-									else
-										sensorsDrivers[driver.id] = driverModule if driver.isSensor
-										actuatorsDrivers[driver.id] = driverModule if driver.isActuator
-										callback null, driver
+						else
+							initializeDriver()
+				else
+					mkdirp dirName, (err) ->
+						if err
+							callback 'Error creating the directory for the driver', null
+						else
+							fs.createReadStream(file.path).pipe(fs.createWriteStream(dirName + file.name + file.ext))
+							initializeDriver()
+
+				# Initialize the driver:
+				initializeDriver = () ->
+					unless driverModule = require dirName + file.name
+						callback 'Couldn\'t find module', null
+					unless isActuator = driverModule.isActuator or isSensor = driverModule.isSensor # or (!isActuator and !isSensor)
+						callback 'Driver not defining if for Sensors and/or Actuators', null
+						
+					unless driverModule.add and driverModule.remove and driver.update and driver.apply and (!isActuator or driver.init)
+						callback 'Driver not implementing the interface', null
+						
+					driverModule.init (err) ->
+						if err
+							callback 'Error initializing the driver', null
+						else
+							# If everything worked, save the Driver instance in DB:
+							data =
+								name: file.name
+								isSensor: isSensor
+								isActuator: isActuator
+							superCreate data, (err, driver) ->
+								if err
+									callback 'Error saving the driver in DB', null
+								else
+									sensorsDrivers[driver.id] = driverModule if driver.isSensor
+									actuatorsDrivers[driver.id] = driverModule if driver.isActuator
+									callback null, driver
 	
 	###
 	# reinit

			else if drivers.length isnt 0 # Driver already exists.
				callback 'Driver already added', drivers[0]
			else
				# Create directory for the driver's files:
				dirName = DRIVERS_DIR + file.name + "/"
				mkdirp dirName, (err) ->
					if err
						callback 'Error creating the directory for the driver', null
						return
						
					# Unzip in it:
					plug = [
						'.zip' : decompress.zip,
						'.tar' : decompress.tar,

		superCreate = super
		
		file = data.file
		unless file.ext = path.extname(file.originalFilename) and file.ext in ['.zip', '.tar', '.tar.bz2', '.tar.gz', '.js', '.coffee']
			callback 'Unknown file extension', null
			return cleanUp()
		unless file.name = path.basename(file.originalFilename, file.ext)
