Home » Developer & Programmer » Forms » Unzip file from froms then load.
Unzip file from froms then load. [message #293130] Fri, 11 January 2008 00:15 Go to next message
musman
Messages: 147
Registered: July 2007
Location: Lahore
Senior Member

i have form (basically called loader) which read text file and then load it in data base.
Now,there is a user requirement that if text file is in zip format then he can unzip file using form.
Any idea how to do this can some unzip software used at back end.
I mean any idea any suggestion is required.
Forms 6i i am using.

[Updated on: Fri, 11 January 2008 00:15]

Report message to a moderator

Re: Unzip file from froms then load. [message #293146 is a reply to message #293130] Fri, 11 January 2008 00:34 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
In the Form determine the extension of the form. If it is 'zip' then use the 'host' command to perform the unzip into an empty directory. Then read the files from that directory.

Remember to get rid of them when you are finished, or keep them and get rid of the zip file.

David
Re: Unzip file from froms then load. [message #295010 is a reply to message #293146] Mon, 21 January 2008 02:37 Go to previous messageGo to next message
musman
Messages: 147
Registered: July 2007
Location: Lahore
Senior Member

Hi i am almost done with reading zip file.
But a bit help required

 bouser varchar2(6):=user;
BEGIN
  BEGIN
--filename:=GET_FILE_NAME('c:\',
File_Filter=>'TextFiles(*.txt)|*.txt|');

filename:=GET_FILE_NAME('C:\', File_Filter=>'All Files (*.*)|*.*|');
LF := TEXT_IO.FOPEN( filename, 'R');
 IF filename LIKE '%zip%' THEN
HOST('copy '||filename||' c:\bkoffice\');  -- command 1
HOST('copy '||filename||' c:\bkoffice\'||bouser||''); -- command 2


command 1 is working fine.
but i want to copy using command 2 which will create unique folder for each user.
but command 2 is not copying file...
Any Idea???

[Updated on: Mon, 21 January 2008 03:34]

Report message to a moderator

Re: Unzip file from froms then load. [message #295249 is a reply to message #295010] Mon, 21 January 2008 21:40 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Don't you have to create the subdirectory first using a 'mkdir' command?

David
Re: Unzip file from froms then load. [message #295277 is a reply to message #295249] Mon, 21 January 2008 23:49 Go to previous message
musman
Messages: 147
Registered: July 2007
Location: Lahore
Senior Member

yes you are right?.
Its Complete Now Thanks.
Previous Topic: how to display ICON in push button
Next Topic: dynamic query
Goto Forum:
  


Current Time: Sun Dec 11 00:30:00 CST 2016

Total time taken to generate the page: 0.18102 seconds