This topic is locked
[SOLVED]

 File Upload

7/1/2014 4:18:42 PM
ASPRunnerPro General questions
J
jmccullough author

I have an Access 2010 database and I have a field in the database "Doc Request" where I would like to be able to upload a file (Word document) into, the data type is Text. In Asprunner 7.2, I have set the View As Type to File and the Edit as type to File/Image. The Upload Folder is set as files. The file I'm uploading is a very small file and it uploads into AspRunner fine. However, in my Access database the field displays as: #[{"name":"files\\aspcode_96yd6z9h.rtf","usrName":"aspcode.rtf","size":802,"type":"application\/msword","searchStr":"aspcode.rtf,!:sStrEnd","Request":""}]#
I found a similar problem on the Forum and added this code to the "Before Record Added" event.
set fileArray = CreateDictionary()

set fileArray = my_json_decode(values("Doc Request"))

' rename each file. In this example - convert to lowercase.

for i = 0 to asp_count(fileArray)-1

fileArray(i)("Request") = LCase(fileArray(i)("Request"))

next

' update values of the field that stores file names

values("Doc Request") = my_json_encode(fileArray)
But it still is doing the same thing. Can anyone tell me what I need to change in order for the file to appear in my Access database.
Thank you for any help.

lefty 7/2/2014



I have an Access 2010 database and I have a field in the database "Doc Request" where I would like to be able to upload a file (Word document) into, the data type is Text. In Asprunner 7.2, I have set the View As Type to File and the Edit as type to File/Image. The Upload Folder is set as files. The file I'm uploading is a very small file and it uploads into AspRunner fine. However, in my Access database the field displays as: #[{"name":"files\\aspcode_96yd6z9h.rtf","usrName":"aspcode.rtf","size":802,"type":"application\/msword","searchStr":"aspcode.rtf,!:sStrEnd","Request":""}]#
I found a similar problem on the Forum and added this code to the "Before Record Added" event.
set fileArray = CreateDictionary()

set fileArray = my_json_decode(values("Doc Request"))

' rename each file. In this example - convert to lowercase.

for i = 0 to asp_count(fileArray)-1

fileArray(i)("Request") = LCase(fileArray(i)("Request"))

next

' update values of the field that stores file names

values("Doc Request") = my_json_encode(fileArray)
But it still is doing the same thing. Can anyone tell me what I need to change in order for the file to appear in my Access database.
Thank you for any help.


I have run into the same problem with no fix. Use the old compatibility view and it should work fine ; unless you need multiple upload . I have tried the new version in ASPrunner to no avail to rename files . What it does is it assigns the image or doc file a new filename with 8 digit intger and the link gets broken , which in turns makes the link not accesible , with a crossed 0Icon**__ . You are getting the json data . ( did you send image as email as that is what you would get as your result ) Wish they would fix this for ASPrunner or better explain it.

J
jmccullough author 7/2/2014

John, thanks for the help. Can I ask what you mean when you say "Use the old compatibility view". Not sure what you mean but definitely want to try it out.
Thank again.

lefty 7/3/2014



John, thanks for the help. Can I ask what you mean when you say "Use the old compatibility view". Not sure what you mean but definitely want to try it out.
Thank again.



In visual editor open the upload field. Click edit tab file/image field. Under Upload options check compatability mode.