I’ve build an application with a ConnectME and Net+Os 7.3 which need configuration files. I’ve build a form to upload file and it work, but I can’t find a way to get the uploaded file name. (So for now I’ve hardcoded a “myconf.cfg” name, and I need to upload file with the this name… not cool).
Is there a way in the code of AWS pages to get this name ?
(I’ve started with the sample application with file upload capabilitie: it has a function upload_submit() in filelist_v.c which is called after the upload has finished. The FilelistPgCache contain a NAFS_DIR_ENTRY_INFO, but it’s always empty…)
Or an jscript way to always upload the file with an hardcoded name (ugly but ok for me)
There is no "easy" way to perform the operation that you discuss in your posting. The only ways I can think of to perform them would be:
a) as you discuss, always upload a configuration file of a known name
b) The file file.c that is compiled into all AWS (Advanced Web Server) applications that include the file system, is the interface file between the AWS and the file system. You’d need to rummage around file.c to find a place where you can grab the file name.
Can you share the code you used to hardcode the “myconf.cfg” for uploading? I am using an AWS application and this will work for what I am trying to do.
/* Used added functions in upload_submit() */
void upload_submit(void *theTaskDataPtr, Signed16Ptr theIndexValuesPtr)
{
…
char fileName[120];
int theFileNumber = RpGetCurrentConnection(theTaskDataPtr); // conn == fNum by design in file.c
int fileSize = getFileSize(theFileNumber);
strcpy(fileName, getFileName(theFileNumber));