Dowload files directly to a sub-folder

Hi,

Sorry for posting here, but seems the network thread is not active…

I’ve created a sub directory in system.DocumentsDirectory and I want to download files directly into that sub-folder I created. When i try and feed it a path other than system base directories, it ignors them and reverts to the default of system.DocumentsDirectory, in spite of adding the subdirectory name.

Is not possible to directly download to the sub-foldr I’ve just created?

Alberto. [import]uid: 44013 topic_id: 36108 reply_id: 336108[/import]

Hi Alberto,
Have you already read through this guide? It might help solve your issue…
http://www.coronalabs.com/blog/2013/02/13/faq-wednesday-sub-folder-and-file-access/

Sincerely,
Brent Sorrentino [import]uid: 200026 topic_id: 36108 reply_id: 143506[/import]

Hi Brent!

Thanks a lot for your reply!
Yes, I read the post, in fact, I make the same question in it but I don’t get response…
I don’t know if the only way is coping files from DocumentsDirectory to the sub-folder I’ve just created (instead of download directly to the sub-folder).

This is how I try:

[code]
local docs_path = system.pathForFile( “”, system.DocumentsDirectory )

– change current working directory
local success = lfs.chdir( docs_path )
local new_folder_path
local dname = “proba”
if success then
lfs.mkdir( dname )
new_folder_path = lfs.currentdir() … “/” … dname … “/”
end

local destino = system.pathForFile("",system.DocumentsDirectory)
lfs.chdir(destino)
local dest = destino…"/proba/"

network.download( origin, “GET”, arqDescargado, arquivo, dest )

``

The files are downloaded to DocumentsDirectory instead of DocumentsDirectory/proba

What am I doing wrong? [import]uid: 44013 topic_id: 36108 reply_id: 143564[/import]

Please, anyone who can help me with this issue?, Brent? [import]uid: 44013 topic_id: 36108 reply_id: 144156[/import]

Hi Alberto,
Have you already read through this guide? It might help solve your issue…
http://www.coronalabs.com/blog/2013/02/13/faq-wednesday-sub-folder-and-file-access/

Sincerely,
Brent Sorrentino [import]uid: 200026 topic_id: 36108 reply_id: 143506[/import]

Hi Brent!

Thanks a lot for your reply!
Yes, I read the post, in fact, I make the same question in it but I don’t get response…
I don’t know if the only way is coping files from DocumentsDirectory to the sub-folder I’ve just created (instead of download directly to the sub-folder).

This is how I try:

[code]
local docs_path = system.pathForFile( “”, system.DocumentsDirectory )

– change current working directory
local success = lfs.chdir( docs_path )
local new_folder_path
local dname = “proba”
if success then
lfs.mkdir( dname )
new_folder_path = lfs.currentdir() … “/” … dname … “/”
end

local destino = system.pathForFile("",system.DocumentsDirectory)
lfs.chdir(destino)
local dest = destino…"/proba/"

network.download( origin, “GET”, arqDescargado, arquivo, dest )

``

The files are downloaded to DocumentsDirectory instead of DocumentsDirectory/proba

What am I doing wrong? [import]uid: 44013 topic_id: 36108 reply_id: 143564[/import]

Please, anyone who can help me with this issue?, Brent? [import]uid: 44013 topic_id: 36108 reply_id: 144156[/import]

Hi Alberto,
Have you already read through this guide? It might help solve your issue…
http://www.coronalabs.com/blog/2013/02/13/faq-wednesday-sub-folder-and-file-access/

Sincerely,
Brent Sorrentino [import]uid: 200026 topic_id: 36108 reply_id: 143506[/import]

Hi Brent!

Thanks a lot for your reply!
Yes, I read the post, in fact, I make the same question in it but I don’t get response…
I don’t know if the only way is coping files from DocumentsDirectory to the sub-folder I’ve just created (instead of download directly to the sub-folder).

This is how I try:

[code]
local docs_path = system.pathForFile( “”, system.DocumentsDirectory )

– change current working directory
local success = lfs.chdir( docs_path )
local new_folder_path
local dname = “proba”
if success then
lfs.mkdir( dname )
new_folder_path = lfs.currentdir() … “/” … dname … “/”
end

local destino = system.pathForFile("",system.DocumentsDirectory)
lfs.chdir(destino)
local dest = destino…"/proba/"

network.download( origin, “GET”, arqDescargado, arquivo, dest )

``

The files are downloaded to DocumentsDirectory instead of DocumentsDirectory/proba

What am I doing wrong? [import]uid: 44013 topic_id: 36108 reply_id: 143564[/import]

Please, anyone who can help me with this issue?, Brent? [import]uid: 44013 topic_id: 36108 reply_id: 144156[/import]

Hi Alberto,
Have you already read through this guide? It might help solve your issue…
http://www.coronalabs.com/blog/2013/02/13/faq-wednesday-sub-folder-and-file-access/

Sincerely,
Brent Sorrentino [import]uid: 200026 topic_id: 36108 reply_id: 143506[/import]

Hi Brent!

Thanks a lot for your reply!
Yes, I read the post, in fact, I make the same question in it but I don’t get response…
I don’t know if the only way is coping files from DocumentsDirectory to the sub-folder I’ve just created (instead of download directly to the sub-folder).

This is how I try:

[code]
local docs_path = system.pathForFile( “”, system.DocumentsDirectory )

– change current working directory
local success = lfs.chdir( docs_path )
local new_folder_path
local dname = “proba”
if success then
lfs.mkdir( dname )
new_folder_path = lfs.currentdir() … “/” … dname … “/”
end

local destino = system.pathForFile("",system.DocumentsDirectory)
lfs.chdir(destino)
local dest = destino…"/proba/"

network.download( origin, “GET”, arqDescargado, arquivo, dest )

``

The files are downloaded to DocumentsDirectory instead of DocumentsDirectory/proba

What am I doing wrong? [import]uid: 44013 topic_id: 36108 reply_id: 143564[/import]

Please, anyone who can help me with this issue?, Brent? [import]uid: 44013 topic_id: 36108 reply_id: 144156[/import]