I was wondering if anyone might know how to import the contents of a folder into a Access table.
I have a database that's used to make ID cards for students with a unique ID. When students get their photos taken to be printed on these cards, the files are saved as jpegs with the student ID numbers as the filename. (E.g., student 1234567's photo would be saved as 1234567.jpg.) These photos are all saved in the same folder.
I would like to be able to have Access (or a script) automatically generate a table for this folder with two columns: the filename and the image (as a BLOB). That way, I would be able to add a student's photo to his or her data record with a simple SQL query.
My VBA skills are not great (I'm in the process of learning), so any help would be appreciated. Thanks!
There is an MS article: http://support.microsoft.com/kb/103257, however, with the recent version of Access (2010), you would be better to consider the attachment data type which will also allow you to display the photo on a form.
Related
Im running Filemaker Server 19 and FileMaker 19 client
I have an app that manages Document Templates, ie Word documents
Each Document Template master record contains information about that template, plus connects to a Document Samples table that contains one Word document (the template) and one PDF document (an output of the template file when used , a bit like mail merge).
We've recently had an update to the system I support (not a Filemaker system) and many hundreds of the Word templates have been updated. If I have to do one or two in a session it's pretty simple to drag the latest version of each template to the Container field; but recently I've been having to do 10s/100s of Document updates very quickly to get them into our system. I've put copies of all the Word documents into a folder on my Mac. They all have a unique name and a unique template id in the format of 1234doctemplate01. So, the 1234 equates to my Document template ID in my database and the filename is also mirrored in a 'Template Name' field in the database.
So, my question is how to build a Script to go through the database one record at a time and, for each, to check the Mac folder and see if there's matching document name and, if there is, to paste/copy it into the appropriate Container field
Can anyone advise, please? Further detail available if this isn't too clear
I would do something slightly different:
Import all the files in the folder into a new table (see https://help.claris.com/en/pro-help/content/importing-folder.html) and create a relationship between this table and your existing table, based on matching template ID or name.
Then you can loop over the records in either table and if a match is found, replace the data in the existing container. Or perhaps you could make this a permanent structure, where the file is stored in a related record.
Doing it the way you have proposed would be awkward using only Filemaker's built-in tools (and outright impossible if the folder is not somewhere within the Documents folder). It might be somewhat easier if you use a plugin (e.g. BaseElements) to read the folder's contents.
You can use base element plugin to select multiple files in a folder with
BE_FileSelectDialog
or check if a file exist with
BE_FileExists
and then looping over the list to insert every file into a container via
set field ["your_container" ; BE_FileImport ( $file )]
I am trying to write a VBA macro to download files from our companies server. In order to download the files, I look for their number of our my excel list. E.G. the number is "250". Then I need to search for "250" on the website and then get the objectID of the file.
So the links of the download document looks like this :
https://plm.corp.int:10090/enovia/tvc-action/downloadMultipleFiles?objectId=***4706.39075.61185.44166***&object=250
4706.39075.61185.44166 this number is what I need to find for every of my numbers from excel, in order to edit the download link and get the files.
in the image you can see how it looks in the source code of the website...
Now I have absolutely no idea how I can extract such data our of source code in VBA
#Zwenn
enter image description here
the E2**** is the number out of excel, that i am searching for on the platform.
The 4706 number form my original question, is the unique ID of every E2***number.
Here's some background information to help understand my dilemma. I've got a system written in PHP where users can fill out a form, upload a few images and everything gets archived in a .zip, I then have an "Account Page" that echo's a simple table containing a list of all of that specific users uploaded .zip's, the reason I'd need separate filepaths for each and every .zip is because no matter the user, they all need to be in the same single folder on the server for the broader application to work (these .zips are used for a mobile based Package Manager; see Cydia).
Would the smarter choice be to have every name of each .zip stored in a table on the database with things like the username and user_id tying to each entry, which would result in a few entries being for one user, and a few more being for a different user (depending on upload time), and everything will be unorganized. If I need to enter the database and manually search for a specific user's uploaded .zip's, I'll have to sort them out by user_id.
OR
Would it be more cost effective (in terms of passing data and hardware limitations) to have an XML file or even a plain .txt file on the server with a list of the users uploaded .zip's, and an exact file path pointing to them, and in the database simply have one column tied to the rest of the users information that points to that file containing multiple lines of filepaths?
It's a mouth full I know, and I have no problem achieving either of them as it's well within my skillset and knowledge of PHP & MySQL, I'm just not too sure which is the most secure and the best practice in the industry for this type of system.
I currently have a form that uploads the data via PHP to a PDF form and that form is generated and saved on my ftp server. The data is also posted to a mysql database and the name of the file name for the pdf is the unique id of the mysql record (eg. 85124.pdf)
I would like to set up a link where the user can print the generated PDF file as a receipt but cannot figure out how to have the link call up the specific file for that specific record.
For example:
pdf - where the filename would be the same as the unique mysql id (eg. 85124). Is this possible?
I see that I may not have stated properly what I am trying to do and in what enviornment.
I have a page set up where users/clients can book their shipments online ( I work for a small shipping company). The user puts in their shipping adress and such and once they hit the submit button the following happens:
The data is sent to a mysql database on my host (godaddy) and the table is populated with that specific record. The unique id becomes the tracking number for the shipment.
$tracking=mysql_insert_id;
The data is also sent as a FDF file to my ftp and stored in a folder. The name of the FTP is determined by what the the tracking number is after it is put into the mysql database.
$fdf_file=$tracking().'.fdf';
$fdf_dir=dirname(__FILE__).'/results';
The data is then placed into a PDF form that is on my ftp.
$pdf_doc='https://www.mysite.com/shipformrso.pdf';
On the screen after the form is submitted the client receives a confirmation that their from was completed properly and they are given their tracking number.
echo "<font color='red' size='+1'><b>" . 'Your tracking number is '.$tracking() . '. <n\> PLEASE PROCEED TO THE SERVICE DESK TO RECOVER YOUR LABELS.' ."</b></font>";
What I would like to do is have another link where the user can click on and have the browser open up the FDF/PDF file was generated for their specific shipment. This is where I have the problem. I can't seem to figure out how to create the link specific file that was just generated.
Thanks for any help.
As much as I understand, you don't want to show the pdf printing link to your users? At least, the id of the pdf file, which is plainly holded in the db? Then, you can hash your id, POST it to the server and decrypt it on server side then proceed to pdf showing/printing page. In this way no user can understand the hash data, and how to decrypt it. Only your server side script does.;)
For ex:
When user enters here:
blabla.com/?id=SOME_HASHED_VALUE
On the server side:
You decrypt it, and make the SOME_HASHED_VALUE to look like this: 45869 - which is the unique id holded in the db. And then proceed normal flow. ;)
In my Grails app, I would like admin users to be able to upload a CSV file that contains data such as:
List of users to be added to system
List of groups to be added to system
Assignment of users to groups
I have no idea how the user will generate these CSV files - most likely from Excel, Access or similar, and therefore I've no way of knowing which column will contain which data. So I'm planning to allow the user to specify which column contains users, groups, etc.
I'm wondering if there's a JavaScript component that could help with this. Ideally I'd like to implement the following:
User uploads file
In browser, user is shown first N lines of uploaded file and prompted to select the column that contains the users, groups, etc.
Column information is uploaded to server
Is there a client/server side component that could help with this, or an entirely different approach which would be superior to that outlined above?
I should emphasise that the users of this system will not be technically gifted, so expecting them to provide an XML/JSON file instead is out of the question (and you can definitely forget about asking them to call a Web Service instead of uploading a file).
Thanks,
Don
I like your solution so far, given that the users are non-technical, and that you want to be able to accept this data as a file upload, rather than have the users enter it directly into your application.
I would simply suggest that when the user uploads the file, the server returns the first five (or so) lines back to the client as an HTML table. Then you can have <select> drop-downs as the headers for each column, with the pre-set options you're looking for. You can validate that the user has assigned all available options to each column (use JS to remove options from the select as they use them, but be sure to provide a method to undo and change selections), and allow some columns not to be labeled (which the server will just ignore when parsing the file.
If possible, also illustrate (perhaps in a graph format or just an example sentence, if applicable) how their label choices will apply to the relationships. For example, "New user ABC will be a member of new group XYZ." If ABC and XYZ are unexpectedly backwards, the user will recognize they made a mistake.
Also, some users will inevitably upload a file where they used rows as columns and columns as rows. Either provide a GUI function to reverse this ("rotate" the table), or let them choose which axis to label.
I would also suggest providing your users with a collection of example files in various formats (Excel, Access, etc), and give them explicit instructions for how to enter the data they want, and step by step instructions to export as CSV and upload.
I have no idea how the user will generate these CSV files - most likely from Excel, Access or similar, and therefore I've no way of knowing which column will contain which data.
I should emphasize that the users of this system will not be technically gifted
With these two things in mind, are you sure that CSV import is the best way to handle bulk user creation? It's a great technical solution, but the question is, will your users be able to take advantage of it?
It may be worth implementing an alternative bulk create option for those who don't get CSV or are scared off by Excel. Perhaps a JS grid that has the required fields where they could manually enter the data for each field and enter as many as they need at once, with a link to upload a CSV file as an option for those who would use it.
For the CSV option, since your users are not technically-minded, it would be better to give them instructions on how to create the csv files that specify the order fields should be in. Along with a screen shot and a sample file.
Another option is to require the field names be the first row of the document, and require that they use specific labels for the fields. If you do that, you could figure out from the first row what order the data is in. You could also put in a check that looks for the titles in the first row and if they're not found, tell the user they need to add the field names to the CSV and re-upload.