C
|
cgphp 11/7/2011 |
Post the code. |
![]() |
Admin 11/7/2011 |
Fred, |
F
|
fmbma author 11/7/2011 |
Fred, do you use any code in your BeforeAdd/BeforeEdit event that might change the uploaded file name or location.
|
![]() |
Admin 11/7/2011 |
As a first step I would try to make sure that $_SESSION["MasterAcctCode"] variable is not empty. Hard to tell what's else might be causing this issue. |
F
|
fmbma author 11/8/2011 |
The session variable holds the correct information. As a first step I would try to make sure that $_SESSION["MasterAcctCode"] variable is not empty. Hard to tell what's else might be causing this issue. |
![]() |
Admin 11/8/2011 |
You need to troubleshoot this code. |
F
|
fmbma author 11/9/2011 |
OK, I stepped through. |
![]() |
Admin 11/9/2011 |
FieldName is the name of the field that stores the name of uploaded file, the one you setup as File. |
F
|
fmbma author 11/9/2011 |
Sergery,
FieldName is the name of the field that stores the name of uploaded file, the one you setup as File. Make sure that field name is DocumentName (case-sensitive). Another thing that is not related to the current issue but still required to make it work. If DocID is your key column, instead of $values["DocID"] you need to use $keys["DocID"]. If nothing helps post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program. |
![]() |
Admin 11/9/2011 |
global $keys; is not required here, $keys is a parameter in this event. |
F
|
fmbma author 11/10/2011 |
I get an undefined variable error if I don't declare it. I've uploaded to the demo account. It's a somewhat stripped down version of the project without security, so I've hard coded the session variable. Go to "Campaigns" then "Campaign Docs" for the upload. global $keys; is not required here, $keys is a parameter in this event. |
![]() |
Admin 11/10/2011 |
A question - is DocID an autoincrement field? If yes, it won't be available in BeforeAdd event. |
F
|
fmbma author 11/10/2011 |
Yes it is autoincrement. I was wondering about that. What should be used in before Add vs. Update? A question - is DocID an autoincrement field? If yes, it won't be available in BeforeAdd event. |
![]() |
Admin 11/10/2011 |
I guess you can use some other way to name file, since it's being moved to a separate folder anyway. You can keep the original file name for example. |
F
|
fmbma author 11/10/2011 |
The example in Help is not finished code - it just points out a simple approach to doing it. It would be nice if there was more complete documentation on the file upload process, unless I just haven't seen it. Here is code that I got working. It saves the file in the subfolder defined by the value in $_SESSION["MasterAcctCode"].
I guess you can use some other way to name file, since it's being moved to a separate folder anyway. You can keep the original file name for example. |