LetoDMS Community Forum
upload w/ script - Printable Version

+- LetoDMS Community Forum (https://community.letodms.com)
+-- Forum: LetoDMS Support (https://community.letodms.com/forumdisplay.php?fid=4)
+--- Forum: Feature Request (https://community.letodms.com/forumdisplay.php?fid=7)
+--- Thread: upload w/ script (/showthread.php?tid=117)

Pages: 1 2


upload w/ script - hoedlmoser - 08-03-2010

I'd like to have the possibility to upload my just scanned documents (as pdf) automatically to the DMS.

means, just calling a certain function of letodms out of a eg bash-script which is run by cron.

do you see any possibility to just implement such a function? or just give me please a hint, which function of letodms to call to just upload a file.

gre3tings, Klaus


RE: upload w/ script - matteo lucarelli - 09-17-2010

The script should call op/op.AddDocument.php passing the required $_FILES and $_POST variables.
If you make some try please post your results to the forum.

Thank you,
Matteo


RE: upload w/ script - max - 03-17-2011

Hey,

(09-17-2010, 03:44 PM)matteo lucarelli Wrote: The script should call op/op.AddDocument.php passing the required $_FILES and $_POST variables.
If you make some try please post your results to the forum.

I have successfully uploaded around 60 documents at a time using the addDocument function in op/op.AddDocument.php file but I didn't use the $_FILE variables.
I had to use wget instead to pass my file location to a script . There are a lot of limitations to this approach, for instance wget takes only one parameter in the query string.
Also you will need to supply your session variables to wget inorder for it to gain access to letoDMS.

BTW, can you tell me how can I pass $_FILES and $_POST variable to a php file? It would be much easier to use this.

Thanks.


RE: upload w/ script - steinm - 03-21-2011

(03-17-2011, 10:22 PM)max Wrote: Hey,

(09-17-2010, 03:44 PM)matteo lucarelli Wrote: The script should call op/op.AddDocument.php passing the required $_FILES and $_POST variables.
If you make some try please post your results to the forum.

I have successfully uploaded around 60 documents at a time using the addDocument function in op/op.AddDocument.php file but I didn't use the $_FILE variables.
I had to use wget instead to pass my file location to a script . There are a lot of limitations to this approach, for instance wget takes only one parameter in the query string.
Also you will need to supply your session variables to wget inorder for it to gain access to letoDMS.

BTW, can you tell me how can I pass $_FILES and $_POST variable to a php file? It would be much easier to use this.

Thanks.

Generally, the wget approach works and it should be possible to pass more than one parameter. If that really doesn't work there is still curl which can definitely handle session (cookies) and do what you want.

Anyway, I would not recommend to do the upload over http but rather use the functions of LetoDMS_Core. That's what is was made for. It is the core functionality of LetoDMS.

I'm planing to distribute a simple command line upload script with one of the next versions (possibly in 3.2.0).

Uwe



RE: upload w/ script - max - 03-22-2011

(03-21-2011, 07:31 PM)steinm Wrote: BTW, can you tell me how can I pass $_FILES and $_POST variable to a php file? It would be much easier to use this.

Thanks.



Anyway, I would not recommend to do the upload over http but rather use the functions of LetoDMS_Core. That's what is was made for. It is the core functionality of LetoDMS.

Uwe

I am sorry but I didn't get that, what did you want me to use? I did use the functions but I am not sure how to pass files over scripts, so I wrote a simple php script which included the addDocument function and all other letoDMS php include files.
Can curl be used to pass $_FILES and $_POST parameters?
I mean. if I used the php CLI, how can I pass the $_FILES and $_POST to it?

Max


RE: upload w/ script - steinm - 03-24-2011

(03-22-2011, 12:28 AM)max Wrote: I am sorry but I didn't get that, what did you want me to use? I did use the functions but I am not sure how to pass files over scripts, so I wrote a simple php script which included the addDocument function and all other letoDMS php include files.
Can curl be used to pass $_FILES and $_POST parameters?
I mean. if I used the php CLI, how can I pass the $_FILES and $_POST to it?

If you use LetoDMS_Core_Folder::addDocument() you don't need any $_FILES or $_POST variables. These variables are provided by php if the upload is done via http. If you write a php script using php CLI you don't have to use curl neither. curl is just for making http request.

Uwe


RE: upload w/ script - papershark - 12-30-2011

(03-17-2011, 10:22 PM)max Wrote: I'm planing to distribute a simple command line upload script with one of the next versions (possibly in 3.2.0).

Uwe

Hi all,

I am facing the same problem. I have wrote a script that generates PDFs from TIF scans to assemble documents of multiple pages. My scanner has no duplex function.Dodgy

Now I want to enhance the script to upload the PDF to a common inbox for further archiving in the DMS.

It would be helpful if someone can help me with a code snippet for bash or perl to perform this upload.

Regards,

papershark



RE: upload w/ script - steinm - 12-30-2011

(08-03-2010, 04:38 AM)hoedlmoser Wrote: I'd like to have the possibility to upload my just scanned documents (as pdf) automatically to the DMS.

means, just calling a certain function of letodms out of a eg bash-script which is run by cron.

do you see any possibility to just implement such a function? or just give me please a hint, which function of letodms to call to just upload a file.

gre3tings, Klaus

It is already there. The utils folder contains a script adddoc.php.

Uwe


RE: upload w/ script - papershark - 12-31-2011

(12-30-2011, 08:46 PM)steinm Wrote:
(08-03-2010, 04:38 AM)hoedlmoser Wrote: I'd like to have the possibility to upload my just scanned documents (as pdf) automatically to the DMS.

means, just calling a certain function of letodms out of a eg bash-script which is run by cron.

do you see any possibility to just implement such a function? or just give me please a hint, which function of letodms to call to just upload a file.

gre3tings, Klaus

It is already there. The utils folder contains a script adddoc.php.

Uwe

Hi all,

thanks for that hint. I have found a script called letodms-addoc in the utils folder.

Trying to call that script results in following:

jupiter # php /var/www/htdocs/leto/utils/letodms-adddoc -f ./20111230_144537.pdf
Content-type: text/html
X-Powered-By: PHP/5.0.4

/usr/bin/php -f /usr/share/letodms/utils/adddoc.php -- $*
jupiter #


No real error message but in fact noting is performed. Any ideas?Huh

Regards,

Papershark





RE: upload w/ script - steinm - 01-03-2012

(12-31-2011, 08:04 PM)papershark Wrote:
(12-30-2011, 08:46 PM)steinm Wrote:
(08-03-2010, 04:38 AM)hoedlmoser Wrote: I'd like to have the possibility to upload my just scanned documents (as pdf) automatically to the DMS.

means, just calling a certain function of letodms out of a eg bash-script which is run by cron.

do you see any possibility to just implement such a function? or just give me please a hint, which function of letodms to call to just upload a file.

gre3tings, Klaus

It is already there. The utils folder contains a script adddoc.php.

Uwe

Hi all,

thanks for that hint. I have found a script called letodms-addoc in the utils folder.

Trying to call that script results in following:

jupiter # php /var/www/htdocs/leto/utils/letodms-adddoc -f ./20111230_144537.pdf
Content-type: text/html
X-Powered-By: PHP/5.0.4

/usr/bin/php -f /usr/share/letodms/utils/adddoc.php -- $*
jupiter #


No real error message but in fact noting is performed. Any ideas?Huh

letodms-adddoc is a shell script. Just have a look at it and adddoc.php to get an idea how it works.

Uwe